Bug Hunting Session
Bug 37349 - Catalan and Catalan (Valencian) have the same menu entry at the language options menu
Summary: Catalan and Catalan (Valencian) have the same menu entry at the language opti...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
3.4.0 RC1
Hardware: All All
: medium major
Assignee: Eike Rathke
URL:
Whiteboard:
Keywords:
: 43572 (view as bug list)
Depends on: 37496
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-19 03:01 UTC by Pau Iranzo
Modified: 2013-12-18 23:54 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Dialog that shows two Catalan entries (85.90 KB, image/png)
2011-05-19 03:26 UTC, Pau Iranzo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pau Iranzo 2011-05-19 03:01:47 UTC

    
Comment 1 Pau Iranzo 2011-05-19 03:26:21 UTC
Created attachment 46895 [details]
Dialog that shows two Catalan entries

The dialog should show Catalan and Catalan (Valencian).
Comment 2 Pau Iranzo 2011-05-19 03:27:08 UTC
Catalan (Valencian) (ca-xv) works fine. But there is something annoying: on the language selection menu on the options windows, shows «Catalan» twice, there is no difference for the «Catalan (Valencian)» and «Catalan», both are shown as «Catalan».
Comment 3 Pau Iranzo 2011-05-19 03:27:45 UTC
Catalan (Valencian) (ca-xv) works fine. But there is something annoying: on the language selection menu on the options windows, shows «Catalan» twice, there is no difference for the «Catalan (Valencian)» and «Catalan», both are shown as «Catalan».
Comment 4 Andras Timar 2011-05-19 03:51:01 UTC
Assigned to myself.
Comment 5 Andras Timar 2011-05-19 13:08:10 UTC
Unfortunately this is not trivial to fix.
It would be trivial to add Catalan (Valencian) to the language list:
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -78,6 +78,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
         < "Bulgarian" ; LANGUAGE_BULGARIAN ; > ;
         < "Belarusian" ; LANGUAGE_BELARUSIAN ; > ;
         < "Catalan" ; LANGUAGE_CATALAN ; > ;
+        < "Catalan (Valencian)" ; LANGUAGE_USER_CATALAN_VALENCIAN ; > ;
         < "Chinese (traditional)" ; LANGUAGE_CHINESE_TRADITIONAL ; > ;
         < "Chinese (simplified)" ; LANGUAGE_CHINESE_SIMPLIFIED ; > ;
         < "Chinese (Hong Kong)" ; LANGUAGE_CHINESE_HONGKONG ; > ;

But this string would never be called in, because in cui/source/options/optgdlg.cxx where the UI language selection listbox is implemented, there is a call to SvtLanguageTable::GetString (http://opengrok.libreoffice.org/xref/libs-gui/svtools/source/misc/langtab.cxx#141) which eventually calls MsLangId::getReplacementForObsoleteLanguage and it changes Catalan (Valencian) back to Catalan (http://opengrok.libreoffice.org/xref/libs-gui/i18npool/source/isolang/mslangid.cxx#463). 

It is because of the non-standard language code: ca-XV.
Comment 6 Pau Iranzo 2011-05-20 06:05:10 UTC
Thanks, Andras. I guess that an specific condition for ca-xv is somewhat we should not do.

ISO-639 codes are just... :(
Comment 7 Caolán McNamara 2011-05-23 04:43:00 UTC
Been talking about spreading bcp47 strings etc around the place for quite a while now, maybe I'll get around to that this year.
Comment 8 Andras Timar 2011-12-07 04:20:10 UTC
*** Bug 43572 has been marked as a duplicate of this bug. ***
Comment 9 Rainer Bielefeld Retired 2011-12-07 08:16:30 UTC
@András:
Is the "BTW translation issue" visible in attachment for Bug 43572 part of the problem proceeded here or should I submit an additional bug for that?
Comment 10 Eike Rathke 2011-12-09 13:47:30 UTC
Indeed internally ca-XV is mapped to ca-ES to not make it escape into document content where XV of the user-assigned ISO 3166 range would be invalid. For the UI localization to be distinguishable under Tools->Options->LanguageSettings->UserInterface this needed a special handling.

Fixed on master
http://cgit.freedesktop.org/libreoffice/core/commit/?id=8c736b8543ca3d36612270cb4ceb2ae0a7abe2e7
and 3-5 http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5&id=eea858f6c7696becab4e67ca00f5ee0293e63718