AJAX:CalendarExtender 未本地化今天
我正在使用 AJAX 库中的 CalendarExtender,并且可以进行本地化。目前一切工作正常,除了当我尝试将其本地化为 Danich (da-DK) 语言时。日历看起来是本地化的,除了“今天”的部分仍然是英文。您如何本地化该部分?
附言。如果无法本地化,我可以隐藏日历的“今天”部分吗?
I'm using the CalendarExtender from the AJAX library with the possibility of localization. Currently everything works fine except when I try to localize it for the Danich (da-DK) language. The calendar looks localized, except the part that says "Today" that remains in English. How do you localize that part too?
PS. And if localization is not possible, can I hide "Today" part of the calendar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
关于:
由于我们认为添加我们自己的资源更值得,所以我们决定隐藏“今天”位。不过,通过将以下内容添加到我们的 css 文件中,可以轻松完成此操作:
Re:
As we deemed it more work that it was worth to add our own resources, we decided to hide the "Today" bit. This was however easily done by adding the following to our css file:
默认情况下,Ajax Control Toolkit 未针对丹麦语进行本地化。您需要稍微定制一下工具包解决方案。下载工具包源并将丹麦语资源文件添加到 MicrosoftAjax.Extended 项目(ExtenderBase 文件夹)中。您只需创建 BaseScriptsResources.resx 文件的副本并将副本文件名更改为“BaseScriptsResources.ds.resx”。我相信您可以轻松找到该文件中必须为您的语言更改的资源值。
之后,将该文件作为链接添加到 AjaxControlToolkit 项目的 ScriptResources 文件夹中。当您构建解决方案时,您将在项目的 bin 文件夹 (da/AjaxControlToolkit.resources.dll) 中找到一个包含丹麦资源程序集的新文件夹。只需将该文件夹与 dll 复制到项目的 bin 文件夹中即可。
By default Ajax Control Toolkit doesn't localized for the Danish. You need to customize toolkit soulution a bit. Download toolkit sources and add Danish resource file into MicrosoftAjax.Extended project (ExtenderBase folder). You may just create a copy of BaseScriptsResources.resx file and change copy file name to "BaseScriptsResources.ds.resx". I believe you easy find which resource value in that file you must change for your language.
After that add that file as a link into ScriptResources folder of the AjaxControlToolkit's project. When you build up solution you will find a new folder with a Danish resource assembly in project's bin folder (da/AjaxControlToolkit.resources.dll). Just copy that folder with a dll to your project's bin folder.
在添加了特定语言的本地化后,我们在使用旧版本 AjaxControlToolkit (4.1) 的遗留项目中遇到了同样的问题。我绝对不想编译我自己的 AjaxControlToolkit 版本。
因此,在深入研究 CalendarExtender 的 JavaScript 源代码后,我注意到文本是从资源加载的,并且可以修改该资源。长话短说,如果您
Sys.Extended.UI.Resources.Calendar_Today
(默认值:Today:{0}
)加载但则资源值将替换为您的值:
显然,如果您的应用程序是多语言的,您将拥有自己的翻译资源文件:
We just had the same problem in a legacy project using an old version of AjaxControlToolkit (4.1), after localization to a specific language has been added. And I definitely did not want to compile my own version of AjaxControlToolkit.
Thus, after digging through CalendarExtender's JavaScript source, I noticed that the text is loaded from a resource, and that this resource can be modified. To make a long story short, if you update
Sys.Extended.UI.Resources.Calendar_Today
(default:Today: {0}
) in JavaScriptthen the resource value is replaced by your value:
Obviously, if your application is multi-lingual, you will have your own translation resource files: