Issue 94901

Summary: PathSubstitution vlang has changed, but not documentation
Product: App Dev Reporter: bmarcelly <marcelly.bernard>
Component: apiAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: gbpacheco, issues, marcelly.bernard, rainerbielefeld_ooo_qa
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Macro to show $(lang), $(langid) and $(vlang) none

Description bmarcelly 2008-10-12 17:11:01 UTC
Service com.sun.star.util.PathSubstitution says :

$(vlang)
The language used by the Office as a string. Like "german" for a german Office.

This was still valid for OOo 1.1.5.
Since at least version 2.3.1, this variable returns a string containing the codes ISO 
639 and ISO 3166 of the User Interface language.
For example
instead of "french"  it is now "fr"
instead of "english" it is now "en-US" 

The IDL documentation should reflect the current values.
The Developer's guide should also be modified, see page
http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/
Predefined_Variables
Comment 1 jsc 2008-10-29 16:15:41 UTC
jsc -> cd: one for you?
Comment 2 Rainer Bielefeld 2014-03-10 16:34:42 UTC
I do not want to modify <https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Predefined_Variables> without any knowledge what I'm doing
Comment 3 bmarcelly 2014-03-11 14:52:59 UTC
Created attachment 82838 [details]
Macro to show $(lang), $(langid) and $(vlang)
Comment 4 bmarcelly 2014-03-11 14:53:27 UTC
An advice from developers at l10n would be very useful beacause they decide for a new language.
See https://wiki.openoffice.org/wiki/Adding_a_new_language_or_locale

The description of the 3 language variables in the Wiki page Predefined variables should be rewritten.

What follows is my understanding.

$(lang), $(langid) and $(vlang) refer to the user interface language, and are expressed as strings.

$(lang) returns the code for a country using the language. 
The reference to ISO 639 and ISO 3166 is incorrect. 
In fact the values are numeric and follow in general the country code used for telephone calls. 
See https://en.wikipedia.org/wiki/List_of_country_calling_codes
Examples:
01 = US, 33 = FR, 49 = DE
But for some languages, the code seems attributed arbitrarily, examples : 
96 = arabic (96x is used by Maldives, Lebanon, Jordan, Syria, Iraq, Kuwait, Saudi Arabia, Yemen, Oman)
86 = simplified chinese (this is the code for China)
88 = traditional chinese (this is the code for Taiwan). 

$(langid) returns the language code used by the Windows Language Code Identifier (LCID).
The links to Microsoft documents are outdated.
Current link : http://msdn.microsoft.com/en-us/library/cc233965.aspx [MS-LCID]: Windows Language Code Identifier (LCID) Reference
The language code is returned in decimal notation, whereas the LCID reference uses hexadecimal. Examples:
1033 = 0x0409 = en-US
1036 = 0x040c = fr-FR
1031 = 0x0407 = de-DE

$(vlang) returns a string containing the letter-code ISO 639 for the language and possibly the letter-code ISO 3166 of the country where the language variant is spoken.
See https://en.wikipedia.org/wiki/Language_code and https://en.wikipedia.org/wiki/Country_code
Examples:
en-US, en-GB, fr, de