DNN中的模块本地化 [英] Module Localization in DNN

查看:99
本文介绍了DNN中的模块本地化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对DNN中的本地化过程了解不多.问题是,如何才能本地化新模块?

I don't know much about the localization process in DNN. The question is that how can you localize a new module?

是否可以在每个模块中分别包含本地化文件?您能提出什么解决方案?

Is it possible to include localization files with every module separately? What solutions can you come up with?

推荐答案

感谢DotNetNuke,模块的本地化非常容易.

Localization of a module is pretty easy thanks to DotNetNuke.

无论您的.ascx(视图)文件位于何处,App_LocalResources文件夹都应始终与该文件处于同一级别.该文件夹中还应该有一个相应的.ascx.resx文件.

Wherever your .ascx (View) file is, the App_LocalResources folder should always accompany it, on the same level. There should also be a corresponding .ascx.resx file in that folder.

view.ascx
App_LocalResources
- view.ascx.resx

一旦您的模块中具有该结构. DNN将立即提取文件.

Once you have that structure in your module. DNN will pick the file up immediately.

在resx中使用该资源字符串.将ResourceKey属性简单地附加到ASP控件的末尾.例如

To use that resource strings in the resx. Simple tack on the ResourceKey property to the end of your asp controls. e.g.

<asp:Label ID="lblExample" runat="server" ResourceKey="lblExample" />

您的resx文件中应该有一个与该标签匹配的lblExample.Text.请注意,它会自动向其中添加.Text.

You should have a lblExample.Text in your resx file which matches up with that label. Note that it adds .Text to it automatically.

如果未显示,则有几件事要检查

If it's not showing up, there are a few things to check

    代码中的
  1. LocalResourceFile属性.它指向什么位置?
  2. 在web.config中设置ShowMissingKeys=true,您会看到缺少的资源字符串.
  1. LocalResourceFile property in code. What location is it pointing to?
  2. set ShowMissingKeys=true in web.config and you'll see what resource strings you're missing.

这篇关于DNN中的模块本地化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆