[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - desktop/source
Eike Rathke
erack at redhat.com
Thu Dec 19 03:33:00 PST 2013
desktop/source/app/langselect.cxx | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
New commits:
commit 8b48c8d1ac7b2a4ef557b9e004a772fa0a6ade71
Author: Eike Rathke <erack at redhat.com>
Date: Thu Dec 19 12:24:31 2013 +0100
use proper LanguageTag fallback instead of dumb startsWith(), fdo#68714
A ca_ES at valencia (=> ca-ES-valencia) locale did not result in
'ca-valencia' UI being selected but 'ca' only instead.
Change-Id: Ifa405add2ff7b45e030b02af4338de195b457cb2
(cherry picked from commit 03e7a16fe2802160b8344058f225a57bdb9c59f5)
diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx
index 49d001a..291e708 100644
--- a/desktop/source/app/langselect.cxx
+++ b/desktop/source/app/langselect.cxx
@@ -58,20 +58,15 @@ OUString getInstalledLocale(
return installed[i];
}
}
- // FIXME: It is not very clever to handle the zh-HK -> zh-TW fallback here,
- // but right now, there is no place that handles those fallbacks globally:
- if (locale == "zh-HK") {
+ ::std::vector<OUString> fallbacks( LanguageTag( locale).getFallbackStrings( false));
+ for (size_t f=0; f < fallbacks.size(); ++f) {
+ const OUString& rf = fallbacks[f];
for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
- if (installed[i] == "zh-TW") {
+ if (installed[i] == rf) {
return installed[i];
}
}
}
- for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
- if (locale.startsWith(installed[i])) {
- return installed[i];
- }
- }
return OUString();
}
More information about the Libreoffice-commits
mailing list