Commit graph

11 commits

Author SHA1 Message Date
Marc Durdin
331c9d2d71 chore(windows): move shared general units to common 2022-06-22 13:58:58 +10:00
Marc Durdin
56d18bfab3 fix(windows): change canonicalization strategy for Windows 7
On Windows 7, we will no longer attempt to canonicalize BCP 47 tags in
the same was as on later OS versions, because there appear to be some
significant differences in how they work, for example, zh-CN is not
converted to zh-Hans-CN on Windows 7, whereas it is on Windows 10.

This commit also refreshes the `KLog` unit which is useful for debugging
these types of scenarios.
2021-09-29 11:34:16 +10:00
Marc Durdin
7a59d073ff chore(windows): address review comments, add test 2021-02-09 06:56:43 +11:00
Marc Durdin
558c8013ee feat(developer): improve BCP 47 canonicalization
Ensures we get a canonical tag per langtags.json as far as we possibly
can. This is a breaking change for the compiler as tags which were
formerly regarded as canonical are no longer regarded that way. This
mostly relates to script subtag but a secondary bug meant that some
other tags would have lost data in the canonicalization process
(because we did a lookup based only on the language subtag previously,
which is a no-no).

See keymanapp/keyboards#1452 for related work.
2021-02-05 16:56:21 +11:00
Marc Durdin
348b29687e fix(windows): avoid invalid language codes in Add Language dialog
Fixes #4343.

This patch makes all language codes from the langtags.json dataset
visible through the Add Language dialog. This avoids situations where
an incomplete code such as "cmo" can result in an error (a script is
required for "cmo" as it is written in either Latn or Khmr).
2021-02-01 10:20:19 +11:00
Marc Durdin
7ad11ca9d2 fix(windows): Upgrading keyboards with transient profiles
Relates to #3561.

If a keyboard has languages installed under one of the four transient
language profiles, then we need to jump through some additional hoops to
upgrade it to the 14.0 model.

This does not yet handle all scenarios around installed but non-loaded
keyboards.
2020-09-29 14:25:57 +10:00
Marc Durdin
6d5ccbd719 fix(windows): add tests and improve canonical options 2020-09-01 09:41:33 +10:00
Marc Durdin
84f0219541 fix(windows): canonicalization
Reworks the BCP 47 tag canonicalization algorithm.
2020-09-01 08:42:56 +10:00
Marc Durdin
485b7dc684 [Developer] Don't overwrite a BCP 47 code that the user has chosen when writing project templates. Fixes #2046. 2019-09-08 08:40:47 +10:00
Marc Durdin
cad4213ec6 Fixes #885. Fixes #891. Canonicalizes, as far as possible, new language IDs as keyboards added to package 2018-05-28 15:47:22 +07:00
Marc Durdin
594eba5814 Fixes #731, fixes #816 - add language dialog adds script and/or region as required and also shows friendly language name when bcp 47 tag entered 2018-05-07 14:36:21 +07:00