Hello,
I have created an addin for which some texts need to be translated. For this translation I have created a resource file (MyTranslations.resx) which contains the English translations. The access of the resource file is internal.
I made a copy of this resource file for the Dutch translations, named MyTranslations.nl.resx
However these Dutch translations are not used, even though the culture of the thread is nl-BE.
Even if I set the culture myself to nl-BE (Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("nl-BE");) the English translations are used.
I tested the same principle in a C# form application and this works fine.
Anyone has an idea? I think the class needs to be set to localizable, but I can't find how.
FYI: the version of NAV is 2009R2, the addin is created in Visual C# 2010 express.
Thanks,
Andy
0
Answers
Andy
I think I would approach this problem slightly different.
In my experience I would not relay on the C# code to determine the correct culture and use the correct language file.
Simply because I had too many situation were this did not work at all.
In my opinion you have following options :
1. You can read from an SQL setup table what language is setup in NAV and then use the correct resource file.
2. There is a command in NAV, GLOBALLANGUAGE that you can use to get the language that NAV client uses. E.G. you can call it via web services
3. You can deploy a small setup file for your dll, where you can allow users to set what language they want to use.
I hope this helps.
Thanks.
thx for pointing me in the right direction. I use the globallanguage function in NAV and pass this to my addin to determine the culture.
Andy