Multilingual solution

蹲街弑〆低调 提交于 2019-12-09 23:45:52

问题


Two questions, hopefully with similar answers.

  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?

  2. 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?

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.

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


回答1:


  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() .

  2. 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. 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.



来源:https://stackoverflow.com/questions/14068562/multilingual-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!