Improvements in internationalization and localization

October 22, 20263 min. read

Musl logo with some of the patches

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:

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 community 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. If it couldn't, it would set the language internally to English (the C locale to be more specific), but assure the consumer that the system was in the locale requested. While this allowed things like apps to use the translations they had available, even if musl lacked those translations, it created inconsistent behavior. The UI would be shown in one language, while the dates for example would be in the wrong format. It also removed incentives to do the right thing and work on locales for musl, and broke testing and some other specific use-cases, as the answer to "does my system support this locale?" would always be "yes", even if asked to set the language to Elvish 🧝‍♀️.

If you want to get more technical details and the rationale behind all the changes, you can search for the relevant threads in the musl mailing list, most specifically the latest patchseries.

Thanks a lot to Rich, Achill, and Pablo for their work on this project, and to NLnet and NGI Zero Core for funding this work.

Help wanted

To avoid losing app translations in your language due to this breaking change, we need to add translations to musl for the said language. This is relatively easy, simply copying a file and adding the definition in your language. Having the definition in your language will be greatly appreciated!

Alternatively, an automated solution using the Unicode Common Locale Data Repository (CLDR) is potentially also possible, but is a harder problem to solve. Any hero wanting to give it a try would be seriously welcomed. Please have a look at musl-locales#1 if you want to help with that.

If you appreciate the work we're doing with Nura and want to support us, consider contributing financially via OpenCollective.

This blog post was written by Pablo. Header image by Oliver.