https://bugs.documentfoundation.org/show_bug.cgi?id=164070
--- Comment #26 from Stephan Bergmann <[email protected]> --- OK, I think I now understand what's going on, at least in the case of duplicate bug 164264 "LibreOffice suddenly changed its language to Tagalog on its own": 1 Andrea used MAR update to move from an original, msi-installed version that did not yet support the Tagalog UI language to a version that does. Due to how newly added optional components are handled by our MAR update (see <https://git.libreoffice.org/core/+/c00014019e6d33bfb4729c563062db1645c48e9d%5E!/> "tdf#161292: Fix create-partial-info for newly added files"), the relevant files for the Tagalog UI language were unconditionally installed then. 2 Originally, Andrea only had LO's "English (United Kingdom)" UI language installed, and runs LO from an Italian (it-IT) system locale. 3 The code that, when starting LO, determines the UI language to use, is split in two relevant parts. First, prepareLocale in desktop/source/app/langselect.cxx assembles a `css::uno::Sequence<OUString> inst` of all installed UI languages. (For Andrea, this originally only contained "English (United Kingdom)", but after the MAR update now additionally contains "Tagalog". The order of the items in the list is effectively random.) Then (under certain conditions), that code calls getInstalledLocaleForSystemUILanguage in svtools/source/misc/langhelp.cxx, passing it that `inst` sequence. That code effectively scans that sequence for an entry that matches the system locale (it-IT in Andrea's case, but for which the sequence contains no match). If no matching entry is found, it then tries with an en-US locale (which also finds no match in Andrea's case), and as a final resort uses the first item from the passed `inst` sequence. Originally, that would always have used the "English (United Kingdom)" entry (which originally was the only entry in the sequence), but now happens to use the "Tagalog" entry (as the order of the entries is effectively random). (What might help somewhat mitigate all this is if the "English (United States)" UI language were always installed, and would not be an optional item in msi-based installations. Then, the above would at least have fallen back to that "English (United States)" instead of the random "Tagalog".) -- You are receiving this mail because: You are the assignee for the bug.
