Translation of AddIn using resource files

ACaignie
Member Posts: 91
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
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
Best Answer
-
Hi 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.
5
Answers
-
Nobody has an idea?
Andy0 -
Hi 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.
5 -
Hi Vremeni4,
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
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions