Hi!
I developed an application in CL and RPG and I want it to be multilingual. Is it possible to programmatically read the system primary language so I can use the same language for my application?[o:p][/o:p]
Software/Hardware used:
ASKED:
November 18, 2009 3:05 PM
UPDATED:
November 20, 2009 3:32 PM
The language identifier (QLANGID) system value specifies the default language identifier for the system.
The CL command RTVSYSVAL SYSVAL(QLANGID) RTNVAR(&RTNVAR) will return the language identifer to your program in the variable &RTNVAR
Thanks for the answers.
That’s exactly what I have done. I made two different message files, one in English and one in French. The problem is to automatically select the proper file based on the system language.
I have two AS/400s here: one installed with English as primary language and the other with French as primary language. The last one also has English installed as secondary language.
I planned to use the QLANGID system value but when I verified on my two AS/400s, both had ENU (for US English) as value. Even if the French system has ENU value, all system menus are in French. That made me think I could not use this value to determine what language I should use.
In fact, I probably don’t understand clearly the purpose of this value. Why all the system menus are still in French if the English language is selected in QLANGID?
I verified in my user profile and the language identifier is set to *SYSVAL so it is supposed to use QLANGID system value.
So the final question is: should I use the QLANGID value and show English menus or read the system primary language and display French menus?
Pierre
Pierre:
When you logon and see English while French is the primary language, DSPLIBL to see the SYS libraries in the list. Then DSPSYSVAL QSYSLIBL to compare the two. If there is a difference, look at the *SBSD for whatever subsystem your job is running in.
A subsystem has an ‘Operational attribute’ that can add a language library to the system portion of jobs that run in the subsystem. That might be a way it’s affected on the dual-language system.
Also, you might want to review manuals for the System Manager product from IBM. You probably don’t want to use that product, but it has a bunch of useful concepts built into it. After getting a feel for what System Manager can do for languages, look into technical details of the software product APIs. (Bruce gave an example of one of them.)
Concepts out of System Manager plus some technical details from the APIs might help in getting the basic ideas.
Tom
The QLANGID system value does have a purpose but, as you found out and I mentioned previously, that purpose has nothing to do with what national language is shown on system display panels. QLANGID (or more properly the job LANGID which is generally inherited from the system QLANGID) can be used to control how characters are to be sorted when cultural sorts are needed (different national languages/cultures can prefer different sort sequences when working with extended characters), what CCSID should be used when creating a file containing character data, etc.
So to answer your “final” question — I would NOT use QLANGID to determine what national language should be used for display purposes.