Hello All,
I created some tools and customized task/menu accordingly. I'd like to know does dgnlib support bilingual? I created two menus right now, chinese and english version. Both menu will show. If MS can hide one menu according to the windows/MS version, it would be prefect. I don't want to create two dgnlib. Thanks a lot.
Hi,
You may be able to do this using Named Expressions using the value of configuration variable _USTN_LOCALE_LANGUAGE. This uses standard Windows codes, 'en' for english and 'zh-cn' for Chinese (there are other Chinese variations).The example illustrated below creates a test with a True/False result depending on the value of _USTN_LOCALE_LANGUAGE.
Download the linked xml file and import it into the named Expression dialog in your DGNLIB (File > Import XML...)
/cfs-file/__key/communityserver-discussions-components-files/343321/IsLocaleEn.xml
Use this Named Expression to control the visibility of the English menu:
Create and apply a similar Named Expression for 'zh-cn' or the variation that you are using.
That should work.
Marc
Answer Verified By: Changsong Ling
Hello Marc,
Thanks for your reply. It is very useful.
I did test as per your example, there are some questions:
1. I created a variable "MyVariable", the value could be 0/1, True/False(all text string instead of boolean T/F)
2. The xml link doesn't work so I cannot download it. I created a new one as per the snapshot, and it should works, it can reture the valve of my text variable.
3. But the visibility test failed by using my named expression. I have tried other existing expression which retures boolean True/False and OK. Even I have revised MyVariable to show True/False(text string) which looks same as the boolean True/False, but failed still. It looks visibility accept boolean True/False only.
4. To get the boolean True/False, I'd like to know hot to set boolean T/F in variable, or convert it to boolean T/F in named expression as per text value of variable?
Thanks a lot!
I tested again, if I used an existing named expression like "Is2DModel", it works, the visibility can change.
Then I created a new named expression which is same as "Is2DModel" except the Internal/External Name/Description, the test result is correct "False", but the visibility cannot work.
Maybe it is not the boolean or text string True/False issue, there are some other places.
After tested, succeed in MS V8i. But failed in CE.
I1. Created a variable PINEAPP_LAN
2. Created two named expression IsPineAppCN/IsPineAppEN, if the variable value is CN/EN, the corresponding named expression are True/False accordingly.
3.Set Show/Hide Test as one of the named expression.
It works fine in V8i. But none of them show in CE ribbon if visibility is set as one of the named expression. Also it is weird that even I have set the chinese menu to Always, it cannot show neither.
Can anyone help me to have a look at the ribbon part? Thanks a lot!
PineApp.dgnlib
In CE, we use MS_GUIDGNLIBLIST. After applying the setting with your one of named expressions, the expected GUI was visible. Here enclosed an image for reference.
Hello Kim,
I have already did so. it works in V8i, but failed in CE.
Does it work on your CE? According to my setting, if there is no variable PINEAPP_LAN defined or its value is EN, only the english ribbon show; if PINEAPP_LAN is CH, only the chinese ribbon show. But none of them show in my CE regardless the variable PINEAPP_LAN.
BTW, did you notice that there is a "custom" suffixed on my chinese ribbon but not on the english ribbon. Shouldn't them be same?
Hello Mr. Ling,
CE is very different with V8i in localized language. In CE, you can change your MS language by selecting File > Settings > User > Preferences > Language with only one MSCE installation. So I don't think it is a good idea to define a variable to determine what language you use.
Hello master Fu,
In fact I didn't access MS language, I defined a variable and named expressions to control which ribbon/menu/task to show.
I think it is better to use a variable to control the ribbon/menu/task, since all the MS/windows are probably english version, but I'd like to show chinese menu for chinese users who is using MS/windows english version.
The menu/task works fine in V8i, but ribbon doesn't work in CE, even I have checked the named expressions in CE, they are OK.
Would you please try the dgnlib in your CE? None of them show here. Thanks a lot.
The way that we handle language support has changed in CE, which I did not take into account in my initial reply. Each of your users can now select their preferred language in User Preferences, which should be remembered between sessions:
That may be the appropriate solution here. If you change this preference from the default of en to zh are your custom menus translated correctly?