汉化FreeTextBox的ImageGallery

转载 2007年09月25日 11:51:00

 汉化ImageGallery

  protected override void Render(HtmlTextWriter writer)
  {
   writer.Write(this.ChineseGallery());
  }
        /// <summary>
        /// 获取控件,汉化之
        /// </summary>
        /// <returns></returns>
  private string ChineseGallery()
  {
   StringWriter writer = new StringWriter(); //提供一个可以写的文本区域
   HtmlTextWriter buffer = new HtmlTextWriter(writer); //让htmlWriter操作这个区域,我们就可以获得这个区域里的内容
   base.Render(buffer); //先让页面画一遍,让我们得到初始的页面html代码
   string html = writer.ToString(); //找到这段代码,我们来处理它,把英文变成汉字
   //
   html=html.Replace("There are no images:","现在还没有图片");
   html=html.Replace("Upload File","上传图片");
   html=html.Replace("Status</div>","状态</div>");
   html=html.Replace("Selected Image","选中的图片");
   html=html.Replace("Create Folder","创建目录");
   html=html.Replace("Delete Image","删除该图片");
   html=html.Replace("/"Upload/"","'上传'");
   html=html.Replace("<legend>Preview","<legend>预览图片");
   html=html.Replace("<legend>Dimensions","<legend>设置显示尺寸");
   html=html.Replace("Original Size","原图大小");
   html=html.Replace("Custom Size","设置为");
   html=html.Replace("Lock image ratio","锁定尺寸比例");
   html=html.Replace("Percentage","百分比");
   html=html.Replace("Image Gallery","我的像册");
   html=html.Replace("<legend>Properties","<legend>图片属性");
   html=html.Replace("Align","横向排列");
   html=html.Replace("Border","边框");
   html=html.Replace("VSpace","左边距");
   html=html.Replace("HSpace","上边距");
   html=html.Replace("Alt","转换文字");
   html=html.Replace("Title","图片标题");
   html=html.Replace("value=/"Insert/"","value='插入到编辑器中'");
   //
   return html;
  }

 

 

引用一个所谓“ImageGallery汉化无错版”的:保存为Ftb.Imagegallery.aspx就可以了:
-----------------------------------------------------------------
<%@ Page Language="C#" ValidateRequest="false" Trace="false" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
protected void Page_Load(Object Src, EventArgs E) {

// *** remove this return statement to use the following code ***
return;

string currentFolder = ImageGallery1.CurrentImagesFolder;

// modify the directories allowed
if (currentFolder == "~/images") {

// these are the default directories FTB:ImageGallery will find
string[] defaultDirectories = System.IO.Directory.GetDirectories(Server.MapPath(currentFolder),"*");

// user defined custom directories
string[] customDirectories = new string[] {"folder1","folder2"};

// the gallery will use these images in this instance
ImageGallery1.CurrentDirectories = customDirectories;
}


// modify the images allowed
if (currentFolder == "~/images") {

System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(Server.MapPath(currentFolder));

// these are the default images FTB:ImageGallery will find
System.IO.FileInfo[] defaultImages = directoryInfo.GetFiles("*");

// user defined custom images (here, we're just allowing the first two)
System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] {defaultImages[0], defaultImages[1]};

// the gallery will use these images in this instance
ImageGallery1.CurrentImages = customImages;
}

}


protected override void Render(HtmlTextWriter writer)
{
writer.Write(this.ChineseGallery());
}
private string ChineseGallery()
{
StringWriter writer = new StringWriter(); //提供一个可以写的文本区域
HtmlTextWriter buffer = new HtmlTextWriter(writer); //让htmlWriter操作这个区域,我们就可以获得这个区域里的内容
base.Render(buffer); //先让页面画一遍,让我们得到初始的页面html代码
string html = writer.ToString(); //找到这段代码,我们来处理它,把英文变成汉字
//
html=html.Replace("There are no images:","现在还没有图片");
html=html.Replace("Upload File","上传图片");
html=html.Replace("Status</div>","状态</div>");
html=html.Replace("Selected Image","选中的图片");
html=html.Replace("Create Folder","创建目录");
html=html.Replace("Delete Image","删除该图片");
html=html.Replace("/"Upload/"","'上传'");
html=html.Replace("<legend>Preview","<legend>预览图片");
html=html.Replace("<legend>Dimensions","<legend>设置显示尺寸");
html=html.Replace("Original Size","原图大小");
html=html.Replace("Custom Size","设置为");
html=html.Replace("Lock image ratio","锁定尺寸比例");
html=html.Replace("Percentage","百分比");
html=html.Replace("Image Gallery","我的像册");
html=html.Replace("<legend>Properties","<legend>图片属性");
html=html.Replace("Align","横向排列");
html=html.Replace("Border","边框");
html=html.Replace("VSpace","左边距");
html=html.Replace("HSpace","上边距");
html=html.Replace("Alt","转换文字");
html=html.Replace("Title","图片标题");
html=html.Replace("value=/"Insert/"","value='插入到编辑器中'");
//
return html;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Image Gallery</title>
</head>
<body>
<form id="Form1" runat="server" enctype="multipart/form-data">
<FTB:ImageGallery id="ImageGallery1"
JavaScriptLocation="InternalResource"
UtilityImagesLocation="InternalResource"
SupportFolder="../images/"
AllowImageDelete="true" AllowImageUpload="true" AllowDirectoryCreate="false" AllowDirectoryDelete="false" runat="Server" />
</form>
</body>
</html>

FreeTextBox 汉化

  • 2011年07月03日 13:19
  • 397KB
  • 下载

画廊etiennelawlor imagegallery真正全屏,使用隐藏状态栏和沉浸式浮动Toolbar

画廊etiennelawlor imagegallery真正全屏,使用隐藏状态栏和沉浸式浮动Toolbar
  • do168
  • do168
  • 2016年06月07日 11:01
  • 385

Orchard.ImageGallery

  • 2016年06月15日 19:38
  • 806KB
  • 下载

ftb.imagegallery.aspx完整源码

  • 2008年05月29日 12:40
  • 14KB
  • 下载

FreeTextBox使用详解 (版本3.1.1)

FreeTextBox使用详解  Author: Annerose     Date:12/16/2005 版本: FreeTextBox 3.1.1  ASP.NET1.1 1.下...

android ImageGallery

  • 2011年05月17日 09:40
  • 1.45MB
  • 下载

【牛腩新闻发布系统】——FreeTextBox控件的使用

最近在学习牛腩新闻发布系统,在学习的前半部分基本上还是没有遇到问题的,但是在视频的后几集学习的过程中,遇到了一些问题,其中之一就是我们在学习到添加新闻这一项中,我们在添加新闻界面上加载了一个FreeT...
  • zmh458
  • zmh458
  • 2017年05月24日 17:46
  • 423

ASP.NET 4.0中使用FreeTextBox和FCKeditor遇到安全问题警告的解决办法

引言 本人在.NET 4.0+VS2010环境下调试一个ASP.NET 4.0程序时使用到富文本控件FreeTextBox 3.2.2。从网络上查询得到这个控件尽管被广泛使用,但是其相关的安全问...
  • bdstjk
  • bdstjk
  • 2012年04月25日 16:01
  • 3930

FreeTextBox的使用

reeTextBox使用详解       1.下载 FreeTextBox 3.2.2   http://down.chinaz.com/soft/25097.htm 2. 安装   ...
  • brokge
  • brokge
  • 2011年08月19日 10:50
  • 2191
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:汉化FreeTextBox的ImageGallery
举报原因:
原因补充:

(最多只允许输入30个字)