Bug 124791 - LO installer is missing UI language codes
Summary: LO installer is missing UI language codes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
6.2.3.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.3.0 target:6.2.4
Keywords:
Depends on:
Blocks: Installer-Windows
  Show dependency treegraph
 
Reported: 2019-04-17 11:41 UTC by Michael Bauer
Modified: 2019-04-25 01:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Bauer 2019-04-17 11:41:30 UTC
Description:
The LO installer does not reliably pick up on the Windows 10 system language being set to Scottish Gaelic (gd-GB) for which there is a full localization of LO.
It has been suggested that this is becuase gd-GB is missing from the LO installer (see bug 82184).
If this is the case, can we please add gd-GB to the installer list of language codes and check if there are any other LO localizations which should also be on the list?

Steps to Reproduce:
Set Windows system language to Scottish Gaelic
Download the msi for LO installation
Choose Default


Actual Results:
The installer installs en-US

Expected Results:
The installer should pick up on the system language and install gd-GB


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Xisco Faulí 2019-04-17 14:16:43 UTC
@Mike Kaganski, any idea why it's happening ?
Comment 2 Mike Kaganski 2019-04-17 21:32:53 UTC
(In reply to Xisco Faulí from comment #1)
> @Mike Kaganski, any idea why it's happening ?

Looking at https://gerrit.libreoffice.org/plugins/gitiles/translations/+/master/source/gd/instsetoo_native/inc_openoffice/windows/msi_languages.po#1688, I see that the same strings are shown when I run installation using

> msiexec /i D:\Downloads\LibreOffice_6.2.3.1_Win_x64.msi ProductLanguage=1084

... so that 1084 must be the code that somehow arrives with the translation. It doesn't look like proper gd LCID; gd-GB should be 1169 (0x0491) according to [MS-LCID] (and simple gd is 145 (0x0091)).

I have no idea how translations are passed to MSI creation scripts; possibly the process itself is even irrelevant, but the problem is somewhere in our BCP-47-to-LCID conversion code... Eike, do you have an idea?
Comment 3 Mike Kaganski 2019-04-17 21:46:18 UTC
i18nlangtag/source/isolang/isolang.cxx lists two values for "gd", "GB": LANGUAGE_GAELIC_SCOTLAND *and* LANGUAGE_GAELIC_SCOTLAND_LEGACY - the latter one being defined in include/i18nlangtag/lang.h as LanguageType(0x043C) = 1084. Somehow that latter one is picked instead of the other (proper) one - maybe just by sorting the list somewhere and finding the first match. Shouldn't there be some change in the language code?
Comment 4 Michael Bauer 2019-04-17 21:55:55 UTC
Not much I can add at this stage other than LANGUAGE_GAELIC_SCOTLAND_LEGACY being a result of Microsoft (I think) originally having lumped Irish Gaelic together with Scottish Gaelic (they're not the same language, it's a bit like the English <> Dutch relationship) and then having split them, eventually.
Comment 5 Eike Rathke 2019-04-23 12:15:05 UTC
I think it's just a matter to update l10ntools/source/ulfconv/msi-encodinglist.txt to use 1169 (0x0491 LANGUAGE_GAELIC_SCOTLAND) instead of 1084 (0x043C LANGUAGE_GAELIC_SCOTLAND_LEGACY) for 'gd' (which even has the comment Gaelic (Scotland)).

@Mike: could you test that on Windows?
Comment 6 Mike Kaganski 2019-04-23 12:22:01 UTC
(In reply to Eike Rathke from comment #5)
> I think it's just a matter to update
> l10ntools/source/ulfconv/msi-encodinglist.txt to use 1169 (0x0491
> LANGUAGE_GAELIC_SCOTLAND) instead of 1084 (0x043C
> LANGUAGE_GAELIC_SCOTLAND_LEGACY) for 'gd' (which even has the comment Gaelic
> (Scotland)).

Thank you very much!

> @Mike: could you test that on Windows?

Definitely.
Comment 7 Eike Rathke 2019-04-23 12:30:07 UTC
Note that 0x0491 was introduced with commit 6b678c135da07f34da1bf7b19562366361e95085 in 2013, for which the commit message says "a bunch of new definitions up to Windows 8.1", so it might be that Windows 7 or earlier would not accept the new value (or not changing the msi value was simply an oversight). However, as of Windows 8 it may really use the new value. The lang.h comment aptly says "apparently it occurred to MS that those are different languages" ...
Comment 8 Mike Kaganski 2019-04-23 12:32:39 UTC
(In reply to Eike Rathke from comment #7)

Thanks; I'll test on my Win7 VM with appropriate setting in "Region and Language" -> "Format".
Comment 9 Mike Kaganski 2019-04-24 14:27:16 UTC
(In reply to Eike Rathke from comment #5)
> @Mike: could you test that on Windows?

Indeed, that was the problem. https://gerrit.libreoffice.org/71242 fixes that. I have tested both in Win10 and Win7.

Eike: thank you very much!
Comment 10 Mike Kaganski 2019-04-24 14:45:44 UTC
(In reply to Michael Bauer from comment #0)
> ... and check if there are any other LO localizations which
> should also be on the list?

Let's limit a bug to a single issue, which in this case is gd-GB. It is fixed now; too broad scope (or description that doesn't simply state findings and expected results, but instead uses some speculations about how a software should change, as in original tdf#82184) make bugs unmaintainable, and so might delay fix to infinite future (e.g., it took more than 4 years to understand that premises of OP were wrong, and what he deemed neglection, was actually a trivial-to-fix bug).

If you find (identify) another language that needs such treatment, you are welcome to file separate bugs (putting this and/or tdf#82184 to see-also). The list with #N/A in bug 82184 comment 31 might be a good starting point. Thanks!
Comment 11 Commit Notification 2019-04-24 14:46:35 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/5dea045b87a923654d6876acec947d973e0df4bc%5E%21

tdf#124791: Fix Gaelic (Scotland) (gd-GB) LCID in MSI installer

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Michael Bauer 2019-04-24 15:20:10 UTC
>but instead uses some speculations about how a software should change

You do realise it has taken me literally *years* to get this answer about why LO does not reliably pick up on the system language settings? The answer to this problem is SO obscure that expecting a locale experiencing this problem to come up with this answer is frankly not very user friendly. If we want to make FOSS and in particular localized FOSS work for people, we need to be pro-active about fixing obscure problems like that linked to UI languages, not wait until someone files a neat bug.
Comment 13 Commit Notification 2019-04-25 01:06:19 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/086701be50e9d95c67f6fdee97b4080419b55e61%5E%21

tdf#124791: Fix Gaelic (Scotland) (gd-GB) LCID in MSI installer

It will be available in 6.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.