532 Commits
Author SHA1 Message Date
Caolán McNamara afc4a48212 more langtag length limits
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie6a84f836be42e4edc16871d8d4dd12a99046d38
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1592
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit cca41c7cfbfb77777fe8a58be53f6f2ba84638ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207068
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-06-21 20:30:25 +02:00
Xisco Fauli a17fc2f658 i18nlangtag: remove applelangid.hxx
Since
commit f1e8fee31e
Author: Khaled Hosny <khaled@aliftype.com>
Date:   Sun Apr 12 23:26:41 2026 +0200

    vcl: Read more names in sft.cxx using HarfBuzz

Change-Id: Ic56c9c68562070b894a1f5119d419f908254261a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205439
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-05-20 14:30:18 +02:00
Stephan Bergmann 811769f009 Consistently use __EMSCRIPTEN__ instead of EMSCRIPTEN macro
...as emsdk 5.0.3 deprecated the predefined EMSCRIPTEN macro (see
<https://github.com/emscripten-core/emscripten/commit/506052bd8b4e23ded7f2351c62ca3b24d40c8cf3>
"Warn about usage of deprecated EMSCRIPTEN macro. NFC (#26381)"), causing
failures like

> In file included from static/source/unoembindhelpers/PrimaryBindings.cxx:29:
> In file included from include/sfx2/viewsh.hxx:35:
> In file included from include/editeng/outliner.hxx:32:
> In file included from include/tools/color.hxx:26:
> include/osl/endian.h:66:15: error: macro 'EMSCRIPTEN' has been marked as deprecated: use __EMSCRIPTEN__ instead [-Werror,-Wdeprecated-pragma]
>    66 | #elif defined EMSCRIPTEN
>       |               ^
> /home/sberg/emsdk/5.0.4/emsdk/emscripten/main/cache/sysroot/include/emscripten/emscripten.h:35:66: note: macro marked 'deprecated' here
>    35 | #pragma clang deprecated(EMSCRIPTEN, "use __EMSCRIPTEN__ instead")
>       |                                                                  ^

To avoid confusion, also suppress the -D$(OS) in
solenv/gbuild/platform/unxgcc.mk that would unnecessarily keep defining
EMSCRIPTEN.

Change-Id: Ic1f187cf1c6417cd95d4092e9cea01a665bd1b2f
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/34
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 50291c2ed83bdb49bb827a4a12905d94b8c42035)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205167
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-05-14 10:11:38 +02:00
Caolán McNamara 81043ab2dd limit langtag variant length
Change-Id: I4fa5d1a01eb55226403922c28cbca94a0d237d11
Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/1154
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit cbc3cb9511d91b8d385da6f16dce5c415c08a5a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/204107
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2026-04-22 19:51:02 +02:00
Noel Grandin 3fd0800f00 fix appendAscii
where we should be appending to the buffer, not writing
to the start.

regression from
  commit fba849c048
  Author: Noel Grandin <noel.grandin@collabora.co.uk>
  Date:   Tue Jan 27 13:29:55 2026 +0200
  tdf#148218 reduce OUString allocations

spotted by mike kaganski

Change-Id: Ifc8ad791126b8279b39208d0cd18ba68b28c9be8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198884
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-02-07 20:18:19 +01:00
Noel Grandin ab1a88da2d tdf#148218 reduce OString alloc in BreakIterator_Unicode::loadICUBreakIterator
use a custom StackString object to avoid heap allocation here.

Shaves 16% of the temporary allocations.

Change-Id: I2628780c9491c0f8b26bbfcbe085d9309c851f55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198280
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2026-01-29 10:23:10 +01:00
Noel Grandin fba849c048 tdf#148218 reduce OUString allocations
we allocate an awful lot of temporary OUString while looking up translation strings.

Add some API to LanguageTag to reduce this by using a common OStringBuffer.

Reduces peak memory usage from 420M to 283M

Change-Id: Ie55267631f2178e3a6590eebf5876c963a4cda69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198197
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2026-01-27 17:15:52 +01:00
Eike Rathke 38a6aa74b6 tdf#168665: Add Extremaduran (Spain) {ext-ES} [0x06B6] locale data
Co-authored-by: Xisco Fauli <xiscofauli@libreoffice.org>

Language list entry will follow in a separate commit to not taint
the translations when backporting.

Change-Id: Iedf3a6d27083592fecdfb3523ccdb522da784d10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192801
Tested-by: Jenkins
Reviewed-by: Eike Rathke <lo@erack.de>
2025-11-03 19:48:24 +01:00
Eike Rathke 28ababa6cc Related: tdf#166056 Add Gronings {gos-NL} [0x06B5] mapping
Change-Id: I4db299a198f8352720071eb1269e3294a4f88270
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183815
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2025-04-07 22:17:19 +02:00
Eike Rathke 795ac9ab98 Related: tdf#164276 Add English (Guyana) [0xBC09] {en-GY} mapping
Change-Id: I87a3d6f7bb8ea70578312ac2894c6badac48652b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180274
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2025-01-15 20:20:32 +01:00
Christian Lohmaier 2d92871441 add Abkhaz (ab) langaugepack
Change-Id: I100b6c5b34d9c377ab2458dda1cf9af14767c6f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179892
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2025-01-12 15:00:39 +01:00
Eike Rathke 6acaa43376 Related: tdf#163903 Add French (Republic of Guinea) {fr-GN} [0x940C]
Change-Id: I2ebea83a757533088fc49a3c849e6b7890277d1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176734
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-11-18 22:45:45 +01:00
Usman Akinyemi ad6f39b19c tdf#90341 Clean up excessive const_cast'ing
These changes improve const-correctness and reduce the need for const_cast
usage.

Change-Id: I1275edfbc0ca5d49a5e8339d1ed11148f6decd1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174701
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-10-23 15:15:38 +02:00
Eike Rathke 8afc6cb5aa Add Santali, Ol Chiki {sat-Olck-IN} [0x06B3] to language list
Change-Id: I3924672759bc12f1ee8a022e8b35c862aefff06d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174901
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-10-14 18:36:38 +02:00
Noel Grandin b076e6a0b9 tdf#158556 avoid a ton of temporary OUString
Change-Id: I5256210d73eb54d4e6ea98b68c1e9eabf8770ccd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172525
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-08-28 19:35:08 +02:00
Noel Grandin 38f16494f8 use local var to simplify code in MsLangId::getScriptType
Change-Id: If3b0709cb2d755ac4e031e2c14d29a1e49fe603f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169202
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2024-06-19 19:37:26 +02:00
Noel Grandin d6b9ce4b5b cool#8570 try to reduce CPU spent in MsLangId::getScriptType
for some reason the optimiser does not like the o3tl::anyOf template
method and does not inline it nicely.

Change-Id: Iab504989185c05caaefae3df34e85b8898c6f0c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167761
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168491
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-06-06 13:05:46 +02:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Noel Grandin f1ef9379fd cool#8570 single-element cache in MsLangId::getScriptType
this method is hit pretty hard, so try a single element cache

Change-Id: I7c9f9285037a181ee24fbdf04cabc15b40a2ff03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167781
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit 18102e3d7f832b8d5e445e427b55654f5bfd30b0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167687
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-18 12:29:08 +02:00
Stephan Bergmann 9adcf67c9b Drop C/C++ DEBUG macro
...(that was defined iff OSL_DEBUG_LEVEL >= 2) and replace its uses with
OSL_DEBUG_LEVEL directly

Change-Id: I807c15a02cc8ced9852287df0afb4808761d19d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165067
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-03-21 16:30:59 +01:00
Gabor Kelemen ab95ed2c4b Use less boost_headers in low level libraries
Most of these don't use boost themselves, nor do they need
it transitively since the use of boost::optional was removed

Change-Id: Ic9dee1c4e160b313ec5b91677b02ffdea6c5779d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164440
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-06 21:23:17 +01:00
Mike Kaganski bf2ae3c25a Use constexpr instead of const
A local const static still needs a constructor the first time, and
the short atomic checks if it is initialized every time the control
flow crosses it.

A constexpr static does not need all of that.

Change-Id: I9c4cc082c7dfafcf6197dbe5a697ab27fdef2711
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162952
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-04 03:39:42 +01:00
Caolán McNamara cb18b12953 cid#1545617 COPY_INSTEAD_OF_MOVE
and

cid#1545748 COPY_INSTEAD_OF_MOVE
cid#1545741 COPY_INSTEAD_OF_MOVE
cid#1545698 COPY_INSTEAD_OF_MOVE
cid#1545594 COPY_INSTEAD_OF_MOVE
cid#1545588 COPY_INSTEAD_OF_MOVE
cid#1545558 COPY_INSTEAD_OF_MOVE
cid#1545545 COPY_INSTEAD_OF_MOVE

Change-Id: I5dfec77a68959b9384fc71a2fc0908c5d1b42869
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160448
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-08 09:34:29 +01:00
Stephan Bergmann a492775fe2 Extended loplugin:ostr: i18nlangtag
Change-Id: I9e5b989f0508d1479572523ab6929828f0f1b85f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160119
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-30 09:00:14 +01:00
Noel Grandin cee0a8b263 tsan:data race in LanguageTag::registerImpl
not important, just reduces noise when running tsan

Change-Id: I96de4f9e70c8165f0c1135e24ae7522266aa0c0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158651
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-30 17:38:07 +01:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...in include files.  This is a mix of automatic rewriting in include files and
manual fixups (mostly addressing loplugin:redundantfcast) in source files that
include those.

Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-23 11:04:42 +02:00
Stephan Bergmann e0c33ec15f loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2023-10-07 00:47:20 +02:00
Gabor Kelemen d5afeecbff Use less libxml2 external headers dependency
Change-Id: I1749628e0104dff856161bc0bdfd343ef0db208e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156784
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-09-29 00:20:57 +02:00
Eike Rathke 8a11d2e0b1 Related: tdf#154832 Official name is Morisyen
Change-Id: Ieae2d95318184e76cd8e533ba37d5a31eb9d2a1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150453
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-04-16 14:11:56 +02:00
Eike Rathke 5a3694a53b Resolves: tdf#154832 Add Creole (Mauritius) {mfe-MU} [0x06B2] locale data
Change-Id: Ia49e3dfb6ef7abc35f981712077018f98ef94297
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150449
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-04-16 11:54:12 +02:00
Noel Grandin bc2101646b loplugin:stringviewparam improvements
improve the check by checking for methods that exclude
using string_view, rather than checking for methods that
__can__ use string_view, which leads to exposing
some holes in our o3tl/string_view.hxx coverage.

Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-14 07:54:28 +02:00
Eike Rathke 48fac1585f Resolves: tdf#154031 Add Rohingya Hanifi {rhg-Rohg-MM} [0x06B1] CTL, RTL
Change-Id: Icb18349ceb4614e777bed15bbc2108e85a0db54d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148911
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-03-15 17:01:36 +00:00
Mike Kaganski 164f4b4a10 Simplify a bit
Change-Id: I71ec9be6b2003971cdf3c4c1a2a7c21092a316ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148184
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-03 16:37:15 +00:00
Eike Rathke 9042340ef9 Add Saraiki {skr-PK} [0x06B0] to language list, CTL, RTL
Change-Id: I2bc1462acbcc69023586333a4c6b10ba415e5ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147233
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-17 22:52:15 +00:00
Eike Rathke 66719bbdf9 Unit test for {es-419} and fallbacks
Change-Id: I3ced70df064cfd331974da7c6713c950a509168c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147183
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-17 02:39:41 +00:00
Eike Rathke 0382e86830 Handle 3-digits UN M.49 region codes in simpleExtract()
Necessary for {es-419} and the like that are predefined language
tags with known LCID mappings.

Change-Id: I46491842fc11836a55cd56327d4f955952c026f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147182
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-17 02:23:48 +00:00
Eike Rathke a9b97301ba Do not add empty language tag to fallback strings
This happened for known tags like es-419 but unhandled in
simpleExtract(), which actually should be implemented as now a few
are mapped as known tags. Prevent adding such empty string.

For that, adjust configmgr/qa/unit/test.cxx to test for the
expected "en-US" instead of "default".

Change-Id: I05f8e35a9d88b42d45e1f2a90aecec5f4470cc79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147135
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-16 22:45:34 +00:00
Eike Rathke 88d0559134 Add unit tests for zh-Hans and zh-Hant mapping and fallbacks
Change-Id: I99db25676e38a85639f4f2fb09b7fc42cc6f8755
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147111
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-02-15 22:45:28 +00:00
Eike Rathke 54d25b36c0 Related: tdf#152781 Pin some known on-the-fly langtags to user-defined LCIDs
These are pulled in by either our own bundled extension
dictionaries (es-*, ca-*), or hunspell dictionary (en-AG), but
have no language listbox entry (and don't need one until someone
insists) thus are generated.

So if selected and in case stored in binary MS file formats ensure
a stable back-and-forth conversion. The on-the-fly 0x7e1, 0x7e2,
... are generated arbitrarily in order as encountered.

Change-Id: I0dc72bf1301b26d5b82e1b271c58fc77c82eea0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145161
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-01-07 02:20:26 +00:00
Eike Rathke 375630ae76 Related: tdf#152781 Stab the 0xE40A {es} vs Latin America quirk
First, the LANGUAGE_SPANISH_LATIN_AMERICA 0xE40A is not a MS
system LCID, it is Spanish 0x00a with sublanguage 0x39 => user
defined (in the range 0x20 to 0x3f). Meanwhile MS reserved 0x580A
for {es-419}, so obsolete the legacy 0xE40A definition and replace
with 0x580A when encountered.

Second, due to the legacy plain {es} mapping being present, an
encountered 'es' (from our bundled dictionary extension) got
mapped to 0xE40A instead of 0xA and thus was added to the
character language listbox (that otherwise suppresses LCIDs
without sublanguage), resulting in a "Spanish {es}" entry.

Besides, it's currently not clear how to actually proceed with
such dictionary situation when, for example, both 'es-ES' and 'es'
dictionaries are present and the 'es' dictionary apparently is
meant as base and contains entries the 'es-ES' does not or 'es-ES'
overrides entries. It might be it's handled half-way in
linguistics, but maybe not even that, I didn't investigate.

Change-Id: Id859731ba5efa65d4a6de429b7f52027aa69327c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145093
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2023-01-05 21:35:29 +00:00
Tor Lillqvist de3b4b0200 Introduce lo_get_app_data_dir() for Emscripten, too
And not just Android. Hardcoded to return "/instdir" to match what is
in the emscripten_fs_image.

Change-Id: I26d4ec5e02ec9900e35ca47f1565a13ad2b723b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144849
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2022-12-28 13:08:56 +00:00
Eike Rathke eb7bbb761f Resolves: tdf#148792 Add Portuguese (Mozambique) {pt-MZ} locale and data
Basically copies pt_PT.xml but replaces translated with
untranslated keywords (AA,AAAA => YY,YYYY), hence no ref="pt_PT"
for LC_FORMAT (and LC_CTYPE).

Also use sort-formats.awk -v group=1 to sort FormatElement by usage
group and formatIndex as those went quite wild over time..

Change-Id: Iececac0ebdd0317fd14ab65f32c08501f3ce32c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143398
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-11-28 17:29:55 +01:00
Mike Kaganski 3d236177be Deduplicate O(U)StringConcatenation
And use an overloaded helper function with a better (?) unified name
to show that the result is not an O(U)String.

Change-Id: I8956338b05d02bf46a6185828130ea8ef145d46b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141203
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-10-11 12:46:01 +02:00
Eike Rathke 8cf717efbd Konkani is CTL, the other unknowns are not ("Western")
Change-Id: If6c9af6d4a6c7faee6231189014401314d1b1f25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141124
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2022-10-08 23:01:13 +02:00
Eike Rathke 5aa2002644 More zh-* legacy
Change-Id: I859bb1d100eed0d1940e31575611f34c1c308698
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140982
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-10-05 17:01:26 +02:00
Eike Rathke 437abb3abb Check acor_langtag for language-script fallback instead of only language
A tag with script could be added for which we don't have locale
data but for the same language in another script. Do not fall back
to that.

With that the share/autocorr/acor_zh-{CN,TW}.dat files created
additional Asian language listbox entries
"Chinese (Simplified, China) {zh-Hans-CN}"
"Chinese (Traditional, Taiwan) {zh-Hant-TW}"
because those are the canonicalized language tags.
Prefer the known legacy zh-CN and zh-TW tags instead.
Could also had happened with any document import.

Which again revealed a flaw in the handling of mapping overrides
where converting from a LanguageType LCID to Locale could yield a
different mapping than from BCP47 to LCID, which in the case of
a fallback for locale data lead to odd side effects.

Change-Id: I1e2aaa8e9f99b6b3bc2c9a661215cb00bddd33d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140939
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-10-04 19:15:45 +02:00
Eike Rathke 24d382a18e Resolves: tdf#150370 Accept 'art-x-...' private-use input in language box
... for artificial constructed languages.

Change-Id: Ifd0f2ca63738eb9bbe78361cd3fdf507f3e397f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139135
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-09-01 11:30:56 +02:00
Eike Rathke 2c2e0568e8 Related: tdf#150370 Convert isValidBcp47() bool to enum LanguageTag::PrivateUse
... to prepare for more finegrained private-use control.

Change-Id: I118c3f5ee6e437435c07ed2cf699c4597e9cdf88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139112
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-08-31 20:49:46 +02:00
Chris Sherlock 09a3e24a8e i18nlangtag: replace tools::Long with long
Revert to long as originally used in commit e81359a9a3:
"added registerImpl() re-entered warning" and then apparently
accidentally broken in the mass conversion commit
e25fd7782a: "long->tools::Long in hwpfilter..oox".

Change-Id: I39c983ddec83c84953bc3db167793944c671894b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135714
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-07 17:51:40 +02:00
Eike Rathke 196f2b6f8e Resolves: tdf#147390 tag oc-FR to oc-FR-lengadoc, oc-ES to oc-ES-aranes
Change-Id: I849e8e2c6cf2a61b81b25c96b79478bc04907b5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135458
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2022-06-06 20:35:27 +02:00