多语言解决方案 [英] Multilingual solution

查看:216
本文介绍了多语言解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

两个问题,希望能有类似的答案.

Two questions, hopefully with similar answers.

  1. 我将在解决方案中发布一个JavaScript软件包,其中将显示错误消息.问题在于我将针对德语,英语和法语.可能还有第四种语言的TBD.解决这个问题的最好方法是什么?

  1. I'll be releasing a JavaScript package in my solution where the error messages are to be displayed. The problems is that I'll be targeting German, English and French. Possibly, also a fourth language TBD. What would be the nicest way to resolve this?

标签名称应绝对进行本地化. CRM 2011中是否有内置方法?像资源表之类的东西?

The label names should definitely be localized. Is there a built-in approach to that in CRM 2011? Like a resource table or something like that?

我目前对(1)的解决方案是使用字符串保留额外的Web资源,并为每种语言分配不同的文件.我可以重新构建它并立即分发所有语言,并且仅使用一个参数,如果我创建设置实体,则可以从GUI设置该参数.有点麻烦.

My current solution for (1) is to keep an extra web resource with the strings and distributing a different file for each language. I may rebuild it and distribute all the languages at once and only use a parameter, possibly settable from the GUI if I create a settings-entity. A bit cumbersome.

我目前对(2)的解决方案涉及很多祈祷和某种神圣的行为. :)

My current solution for (2) involves a lot of praying and a divine act of some sort. :)

推荐答案

  1. 要从Javascript动态确定当前的CRM用户语言,可以使用window.USER_LANGUAGE_CODE(此变量在所有CRM页面上都存在)-例如,对于英语,它等于1033.根据这些信息,您可以从文件中选择所需的字符串资源. 同样在表单上下文中,有两个预定义的函数,它们返回当前的组织语言代码和当前的用户语言代码:Xrm.Page.context.getOrgLcid()Xrm.Page.context.getUserLcid().

  1. To determine current CRM user language dynamically from Javascript you can use window.USER_LANGUAGE_CODE (this variable exists on all CRM pages) - for example it will be equal 1033 for English. Than based on that info, you can pick needed string resources from your file. Also in forms context there are two predefined functions, which return current Organization language code and current User language code: Xrm.Page.context.getOrgLcid() and Xrm.Page.context.getUserLcid() .

如果您在谈论自定义实体和字段,则可以通过您的解决方案轻松为其添加本地化的显示名称.您需要从解压缩的解决方案中编辑customizations.xml文件.对于每个属性,您都会找到包含显示名称的XML:

If you are talking about custom entities and fields, you can easily add localized display names for them via your solution. You need to edit customizations.xml file from your unzipped solution. For each attribute there you will find such XML containing display names:

  <displaynames>
    <displayname description="Created By" languagecode="1033" />
  </displaynames> 

您可以在此处为每种所需的语言添加新的显示名称.

You can just add new display names for each language you need there.

P.S.如果有人对Dynamics CRM 2011解决方案的多语言支持的不同方面感兴趣,强烈建议阅读此

P.S. If someone interested in different aspects of multilangual support for Dynamics CRM 2011 solutions, I strongly recommend to review this page, also here and here is a very helpful reading.

这篇关于多语言解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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