Switching languages programmatically?

Alx
Member Posts: 38
Hello!
Does anyone know if it is possible to change the UserLanguage IN a report? The thing is, I have a report all set up with CaptionML in Greek and English. What I want to do is check the Country Code of the customer and print the Greek captions for Greek customers and the English captions for all the others. Is it possible to write code for this or should I tell my customer to manually switch languages?
Thanx,
Alx
Does anyone know if it is possible to change the UserLanguage IN a report? The thing is, I have a report all set up with CaptionML in Greek and English. What I want to do is check the Country Code of the customer and print the Greek captions for Greek customers and the English captions for all the others. Is it possible to write code for this or should I tell my customer to manually switch languages?
Thanx,
Alx
0
Comments
-
Isn't this standard Navision ?
CurrReport.LANGUAGE
Look in Report 206 Invoice
Succes0 -
Yes it is, you are right! :oops:
Thanks for the quick response!
Alx0 -
Hi there,
in this context I have another question:
imagine a customer in poland, on customer card you switch his language to polish. for your Items you have extended texts in polish
they will appear in sales lines, as far as that ok.
imagine further you have a german localisation of navision.
as far as you didn't translate all the fields in the order confirmation report
there will be printed german labels instead of the english ones.
My boss says that he once had seen a table where you can put a setting
which language is the default when desired isn't available.
But unfortunately he can't find it again, neither can I.
Has anyone an idea what we are looking for?regards,
Michael Schumacher
oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)0 -
As far as I know the languages are linked indeed.
Default is the current language, then comes the related langage, then english (ENU) then, if no enu is present the first language layer and if no langages are in the database, then the fieldname.
Example
Language = NLB (Dutch Belgium)
If not present = NLD (Dutch)
if not present = ENU
if not present = fieldname.
I don't know if these dependences can be set up somewhere.0 -
1. You set up a "Navision Language Code" (e. g. ENG) to the customer.
2. In the table "Languages" (Table 9), you can set up, which Windows Language should be used, if you use ENG.
Normally, you would use 2057, but you also could define any other (also non-english) Windows language.
3. Now, if you have defined 2057 for ENG, but your report does not support this, it looks in the table "Windows Language" what is the Primary Language ID and will find 1033.
You cannot change anything in the table "windows language" because it is a virtual table.Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
-
That's not that, what I wanted:
I want to give the correct language codes to customers, so that they can take the correkt item extended text.
But in reports there normally only should be english and german for the fieldnames and Textvariables, besides a customer wants to have the work to translate all fields and Variables ;-).
But there should be a setting that english will be used as fallback language instead of german, when no translation in the correct language exists.
The Working language in Navision to the navision user still should be german!
so if a language is selected on customer card which is not a german language, english should be default....
I don't know how to explain it better in english, because I'm not english ;-)regards,
Michael Schumacher
oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)0 -
Michael Schumacher wrote:That's not that, what I wanted:
I was affraid of that but I hoped my post gave you an 'Aha-erlebnis'0 -
Mark Brummel wrote:Michael Schumacher wrote:That's not that, what I wanted:
I was affraid of that but I hoped my post gave you an 'Aha-erlebnis'
seems more than "auweia"regards,
Michael Schumacher
oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)0 -
I hope, I understand correctly:
- In Sales Order, you will get the polish extended texts due to the language code PL.
- In Report, you will print the labels in english because there is no polish text layer
The solution is what I wrote:
Open the form 9 "Languages",
find the record for polish (e. g. "PL")
set the "Windows Language" to 1033
This will not affect the language of the whole Navision client, only the current language of the report at runtime.Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Timo Lässer wrote:Open the form 9 "Languages",
find the record for polish (e. g. "PL")
set the "Windows Language" to 1033
This will not affect the language of the whole Navision client, only the current language of the report at runtime.
Hmmmm, ok so for reports there is always used the windows language?
I'll give it a try.....
OK, this works, as long as there are no translations in the report wanted...
but if you have some words translated to polish this will still be printed in english :-(
So, if noone else has got an idea we (resp. our customers, who sell to poland) have to live with itregards,
Michael Schumacher
oh, what day is it? Backup day. OK, let's dump all data to /dev/nul ;-)0 -
Michael Schumacher wrote:Timo Lässer wrote:Open the form 9 "Languages",
find the record for polish (e. g. "PL")
set the "Windows Language" to 1033
[...]
but if you have some words translated to polish this will still be printed in english :-(
[...]
See as example the report 204, dataitem "Sales Header":Sales Header - OnAfterGetRecord() CurrReport.LANGUAGE := Language.GetLanguageID("Language Code");
Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
This still does not explain why, also on forms in a belgian database the language first is swiched from NLB to NLD and then to ENU.
This must be stored in Navision internaly I think.
This goes also for
FRB-FRA-ENU
and I think also
DES-DEU-ENU
??????0 -
Yes, on forms, Navision works as you mentioned.
What I wrote is only valid for Reports which have the code line as in report 204, otherwise the report will be executed in the application language.Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]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