汉化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
  • 339

Orchard.ImageGallery

  • 2016-06-15 19:38
  • 806KB
  • 下载

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的使用

reeTextBox使用详解       1.下载 FreeTextBox 3.2.2   http://down.chinaz.com/soft/25097.htm 2. 安装   ...
  • brokge
  • brokge
  • 2011-08-19 10:50
  • 2093

让FreeTextBox(一个HTML编辑器) 支持上传本地图片并插入编辑器中

====================================================== 注:本文源代码点此下载 =============================...

新闻编辑工具 freetextbox的使用方法

freetextbox的下载地址:http://www.freetextbox.com/ freetextbox界面如下:   使用方法: 1、下载 FreeTextBox  (下载地址如...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

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