【发布时间】:2012-01-19 02:42:33
【问题描述】:
我已使用 Visual Studio 2010 (VB)/asp.net 4.0 本地化了我的大部分网站。
大部分进展顺利,但我正在尝试本地化contactengineering.aspx。在这里,我有两个问题:asp:checkbox 和 asp:button。他们不读取 fr、de 和 es 文件——只读取默认的 contactengineering.aspx.resx,即 en。
我所做的是在 VS(工具/生成本地资源)中创建资源文件,将其放在 App_LocalResources 的目录中。这就是奥秘。我的 asp:label 也没有翻译。但我把这个修复放在:
<h1><asp:Label ID="Label1" runat="server"
Text="<%$ Resources:LocalizedText, contacteng1 %>"></asp:Label></h1>
我在我的根文件夹中的 App_GlobalResources 中放置了一个用于contacteng1 的字符串,并将其本地化为所有语言。
问题出在这里
同样,我的 asp:button 和 asp:checkbox 函数没有本地化。他们正在读取默认的 /App_LocalResources/contactengineering.aspx.resx。我尝试了我想出的“修复”,将其移至 GlobalResources,但它不起作用。
这是我正在尝试本地化的代码:
<asp:CheckBox ID="CheckBoxCC" runat="server"
Text="does not matter what I put here"
meta:resourcekey="CheckBoxCCResource1" />
<br />
<br />
<asp:Button ID="SubmitForm" runat="server" OnClick="SubmitForm_Click"
Text="Submit Form" meta:resourcekey="SubmitFormResource1" />
除此按钮和复选框外,整个页面都已本地化。谁能告诉我我需要做什么?我真诚地感谢任何人在这方面可以提供给我的任何帮助。
【问题讨论】:
标签: asp.net visual-studio visual-studio-2010 forms localization