Locale and UI language

Continuing the discussion from Business Week Day:

As I have mentioned in the linked post, Locale is not the exact same as UI language.

I’ll take KDE (Linux and Qt) as an example here:

As we see, in the first screenshot one can select the UI language. This, well, defines the language of the UI and everything you see on screen, except what in the second screenshot.
Second screenshot allows defining the locale of the user, and override Numbers, Time, Currency, Units and Sorting.
This is important as many use the system in their preferred language, but are living in a different country where they have different preferences for the locale.

I’ll take examples from my region, the Arab region:

Therefore, dates are affected by these differences:

  • All countries write from right to left.
  • Mashriq countries: ⁨١٢ يناير ٢٠٢٠⁩ = 2020 January 12 (Read from right to left)
  • Maghreb countries: ⁨12 جانفي 2020⁩ = 2020 January 12 (Read from right to left)
  • Simply put: Was it Eastern numerals or Western/Arabic numerals, it is written from right to left, which makes it even harder to decide on the numbers let the format.

Even the Thousands separator is different:
(Eastern Arabic numerals also have another separator: ١٠٬٠٠٠٫٠٠: image )

How it affects Discourse:

  • Date and time formats, numbers, start of business week.

What is not affected:

  • Relative dates.

Ideal solutions:

  • Extract and bake Unicode formats and allow the user to select any locale they like. This needs thinking as it might conflict with Moment.JS.
  • Provide all the means and ways for translators to select which format to show where in the software.

There are no plans to split up the current locale system into locale and UI language in the near future. However, I agree, it would be a good thing to do.

Anyway, I think the current system can already be used to create region specific locales. We have client.en_US.yml and server.en_US.yml which override date/time formats, numbers, etc.

I’m sure something similar could be done for Arabic. It should even be possible to do this with a plugin.