Issue 114155 - configmgr: fall back to "en" locale
Summary: configmgr: fall back to "en" locale
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: current
Hardware: All All
: P3 Trivial with 1 vote (vote)
Target Milestone: 3.4.0
Assignee: b.osi.ooo
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 16:36 UTC by Stephan Bergmann
Modified: 2011-01-24 09:47 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Stephan Bergmann 2010-08-27 16:36:22 UTC
The comments in issue 114078, and
<http://languagetool.cvs.sourceforge.net/viewvc/languagetool/JLanguageTool/openoffice/Addons.xcu?revision=1.27>
cutting occurrences of xml:lang="en-US" to xml:lang="en", made me think that it
would be better if the code at
<http://hg.services.openoffice.org/DEV300/file/87f4911ea629/configmgr/source/childaccess.cxx#l279>
would also try "en" as a fallback when the first fallback of "en-US" was
unsuccessful.  That way, in the above Addons.xcu example, unavailable locales
would fall back to "en" instead of the first item within the configmgr
implementation, which typically is not the textually first one in the .xcu file,
but rather the lexicographically smallest one, like "be".
Comment 1 Stephan Bergmann 2010-08-27 16:41:28 UTC
.
Comment 2 fyva 2010-08-28 09:03:42 UTC
sb, what will be the default language if no en-US, en, en-ZA, en-GB provided? If
for example, xcu provides 3 languages (fr, es, de), how to make fr to be default?
Comment 3 fyva 2010-08-28 10:06:55 UTC
IMHO, the textually first in xcu should be default. In
http://languagetool.cvs.sourceforge.net/viewvc/languagetool/JLanguageTool/openoffice/Addons.xcu?revision=1.27
"en" is textually first and would be default language. Then it will not be
needed to check en-US or en and the algorithm will be fast.
Comment 4 fyva 2010-08-28 10:28:25 UTC
There also can be values with no xml:lang="zz", just <value>xxx</value>. Does it
mean that that value would be default? Maybe then it is sufficient to remove
xml:lang="zz" for languages that are supposed to be default?
Comment 5 Stephan Bergmann 2010-08-30 08:11:57 UTC
@fyva,
<http://hg.services.openoffice.org/DEV300/file/87f4911ea629/configmgr/source/childaccess.cxx#l279>:
"defaults are the empty string locale, the 'en-US' locale, the first child (if
any), or a nil value (even though it may be illegal for the given property), in
that order", where "empty string locale" means a <value> without xml:lang
attribute, and "the first child" effectively means picking a random element.
Comment 6 Stephan Bergmann 2010-09-23 15:19:23 UTC
fixed as <http://hg.services.openoffice.org/cws/sb132/rev/630d6876c61c>
Comment 7 Stephan Bergmann 2010-11-02 10:28:13 UTC
@tbo: please verify (for testing, see reference to Addons.xcu above)
Comment 8 b.osi.ooo 2010-11-08 12:09:24 UTC
It works now as described from sb Mon Aug 30 07:11:57 +0000 2010 
added is now, if no 'en-US' is available, the next candidate is tried: 'en', and
then the list as described by sb.
verified
Comment 9 b.osi.ooo 2011-01-24 09:47:31 UTC
integrated into master DEV300m93 - closing