国际化问题,在线等!!!!

zhanglong_longlong 2010-07-21 03:56:59
up
...全文
112 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhanglong_longlong 2010-07-21
  • 打赏
  • 举报
回复
我知道了,问题找到了,给分了
Dream_Format 2010-07-21
  • 打赏
  • 举报
回复
protected void btnChinese_Click(object sender, EventArgs e)
{
Session["Culture"] = "zh-cn";
this.RegisterClientScriptBlock("reload", "<script>window.location=window.self.location;</script>");
}
protected void btnEnglish_Click(object sender, EventArgs e)
{
Session["Culture"] = "en-us";
this.RegisterClientScriptBlock("reload", "<script>window.location=window.self.location;</script>");
}
protected void button1_Click(object sender, EventArgs e)
{
Session["Culture"] = "riyu";
this.RegisterClientScriptBlock("reload", "<script>window.location=window.self.location;</script>");
}

你这些session存的名称都一样...? 会不会有问题....
mengqizhangqi 2010-07-21
  • 打赏
  • 举报
回复
什么意思不太明白
zhanglong_longlong 2010-07-21
  • 打赏
  • 举报
回复
这是App_GlobalResources文件:有三个:Strings.en-us.resx英文 Strings.resx中文 Strings.riyu.resx这是我新加的日文的,就报String命名空间已定义,怎么回事。
zhanglong_longlong 2010-07-21
  • 打赏
  • 举报
回复
这是我的 index.aspx前台页面<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="btnChinese" runat="server"
Text="<%$ Resources: Strings, btnChinese %>" onclick="btnChinese_Click" />
<asp:Button ID="btnEnglish" runat="server"
Text="<%$ Resources: Strings, btnEnglish %>" onclick="btnEnglish_Click" />
<asp:LinkButton ID="linkbutton1" runat="server" Text="<%$ Resources: Strings, linkbutton1 %>" onclick="btnEnglish_Click"></asp:LinkButton>
<asp:Button ID="button1" runat="server" Text="<%$ Resources: Strings, button1%>" onclick="button1_Click" />
</form>
</body>
</html>

后台:protected void btnChinese_Click(object sender, EventArgs e)
{
Session["Culture"] = "zh-cn";
this.RegisterClientScriptBlock("reload", "<script>window.location=window.self.location;</script>");
}
protected void btnEnglish_Click(object sender, EventArgs e)
{
Session["Culture"] = "en-us";
this.RegisterClientScriptBlock("reload", "<script>window.location=window.self.location;</script>");
}
protected void button1_Click(object sender, EventArgs e)
{
Session["Culture"] = "riyu";
this.RegisterClientScriptBlock("reload", "<script>window.location=window.self.location;</script>");
}



PageBase.cs


protected override void InitializeCulture()
{
string currentCulture = (string)Session["Culture"];
if (string.IsNullOrEmpty(currentCulture))
{
currentCulture = "zh-cn";
Session["Culture"] = "zh-cn";
}

System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(currentCulture);
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(currentCulture);

}
问题是这样的,本来中文和英文是好的,我现在就是要加个日文,我是按照原来的那样加的,可是报String命名空间已定义。红色是我新加的日文代码
journey_q 2010-07-21
  • 打赏
  • 举报
回复
国际化的什么问题

都不说清~~~

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧