distronews.com stable7.3.1
postmarketOS Blog

Improvements in internationalization and localization

postmarketos.org

Key points

With work funded by an NGI Zero Core grant, musl has gained much better localization and internationalization support. The changes are not yet fully merged in musl or Alpine but can already be tested, and postmarketOS expects them to reach Nura some time after the v26.12 release.

What changed

  • Where the name of May has more than three letters in a language, musl now tells the abbreviated form apart from the full one.
  • musl now supports a comma as the decimal separator, so languages that write 1,5 rather than 1.5 get the expected number format, as long as localization files for the language exist.
  • Sorting of files, and of anything else that relies on the C library for ordering, now follows standard collation rules: "A" and "a" sort together and always ahead of "B" and "b", which was not true before.
  • Placement of some characters may still be off. musl can now handle language-specific rules, such as where "ä" goes relative to "a", but the tooling that turns those rules into files musl can read does not support this yet.

Breaking change

  • Once the changes are integrated, languages without a musl-locale will no longer get translated user interfaces, even when the applications themselves ship translations for them.
  • The new behaviour is not expected in a stable release before v27.06, which leaves time for the community to add the missing locales.
  • Until now musl accepted any locale it was asked to set. If it could not find the locale, it quietly fell back to English (the C locale) while still telling the caller the requested locale was active.
  • That fallback let applications use their own translations, but it caused inconsistencies, such as an interface in one language with dates in the wrong format.
  • It also removed the incentive to write musl locales and broke testing and some other uses, because the system always answered "yes" when asked whether it supported a locale, even a made-up one such as Elvish.
  • Technical details and the reasoning behind the changes are on the musl mailing list, mainly in the latest patch series.

How to help

  • To keep application translations in your language, musl needs a locale definition for it. Adding one means copying an existing file and filling in the definitions for your language.
  • Generating locales automatically from the Unicode Common Locale Data Repository (CLDR) may also be possible but is a harder task. Volunteers are asked to look at musl-locales#1.
  • The project credits Rich, Achill and Pablo for the work, and NLnet and NGI Zero Core for funding it. Financial support for Nura can be given through OpenCollective.

Summary by DistroNews, based on the original post.

As part of an NGI Zero Core grant, musl has now massively improved its support location and internationalization. Although the changes are not yet fully merged in musl and Alpine, they are ready for testing, and you can expect them to land in Nura at some point after the v26.12 release. New features From the user perspective, a few new features have landed with these changes: On languages where May is longer than 3 letters, musl is now able to distinguish between abbreviated and non-abbreviated versions. There is now support in musl for the decimal separator to be a comma. Languages where "one and a half" is written as 1,5 instead of 1.5 will now get numbers in the right format, provided localization files for the language exist. Ordering of files (and anything else that depends on the C library for ordering) now follows standard ordering rules. For example, "A" and "a" are now ordered together, and always come before "B" and "b", which wasn't the case before. Ordering of some specific characters might not be perfect yet. For example, different languages have different expectations of where should umlauts like "ä" be placed in relation to "a". musl now has support for that, but the tooling that takes the rules and transforms them into files that musl can read don't support this yet. Breaking changes From the user perspective, these changes come with a breaking change. After the changes get integrated, languages which don't have a musl-locale will stop seeing translations to their languages in the UI, even if the apps have translations for them (if you want to help, please see the section below). Since the updated musl behavior will not land in a stable release before v27.06, there is plenty of time for the communnity to collectively reduce the impact of this change. This change had to be made, because previously musl would just always accept any kind of locale being set. If it could find the locale, it would set the language appropriately.

This is the opening of the story. The full text is on the original page.

Read the original at postmarketos.org