summaryrefslogtreecommitdiffstats
path: root/docs/USER_RECORD.md
diff options
context:
space:
mode:
authorAdrian Vovk <adrianvovk@gmail.com>2024-02-04 18:27:01 +0100
committerAdrian Vovk <adrianvovk@gmail.com>2024-02-13 23:39:14 +0100
commit49e55abb7f74f0ae38e81356654746affa0d290f (patch)
tree33a3d9cee0903ea9752e8dff36a010462ad3a894 /docs/USER_RECORD.md
parentlocale-util: Restrict valid locales (diff)
downloadsystemd-49e55abb7f74f0ae38e81356654746affa0d290f.tar.xz
systemd-49e55abb7f74f0ae38e81356654746affa0d290f.zip
user-record: Add languages field
This field is like preferredLanguage, but takes a priority list of languages instead. If an app isn't translated into a user's primary language, it can fall back to one of the other languages in the list thus making the app more accessible to the user. For instance: in my experience, many Ukrainians are fluent in Russian, often significantly better than English (especially if they are of a generation that grew up during the USSR). Such a person might set this new variable to ["uk_UA.UTF-8", "ru_UA.UTF-8"] so that software that lacks Ukrainian translations will first try Russian translations before defaulting to English. Fixes #31290
Diffstat (limited to 'docs/USER_RECORD.md')
-rw-r--r--docs/USER_RECORD.md21
1 files changed, 16 insertions, 5 deletions
diff --git a/docs/USER_RECORD.md b/docs/USER_RECORD.md
index 60f75bf39d..aba45c39f4 100644
--- a/docs/USER_RECORD.md
+++ b/docs/USER_RECORD.md
@@ -310,11 +310,22 @@ string. The string should be a `tzdata` compatible location string, for
example: `Europe/Berlin`.
`preferredLanguage` → A string indicating the preferred language/locale for the
-user. When logging in
+user. It is combined with the `additionalLanguages` field to initialize the `$LANG`
+and `$LANGUAGE` environment variables on login; see below for more details. This string
+should be in a format compatible with the `$LANG` environment variable, for example:
+`de_DE.UTF-8`.
+
+`additionalLanguages` → An array of strings indicating the preferred languages/locales
+that should be used in the event that translations for the `preferredLanguage` are
+missing, listed in order of descending priority. This allows multi-lingual users to
+specify all the languages that they know, so software lacking translations in the user's
+primary language can try another language that the user knows rather than falling back to
+the default English. All entries in this field must be valid locale names, compatible with
+the `$LANG` variable, for example: `de_DE.UTF-8`. When logging in
[`pam_systemd`](https://www.freedesktop.org/software/systemd/man/pam_systemd.html)
-will automatically initialize the `$LANG` environment variable from this
-string. The string hence should be in a format compatible with this environment
-variable, for example: `de_DE.UTF8`.
+will prepend `preferredLanguage` (if set) to this list (if set), remove duplicates,
+and then automatically initialize the `$LANGUAGE` variable with the resulting list.
+It will also initialize `$LANG` variable with the first entry in the resulting list.
`niceLevel` → An integer value in the range -20…19. When logging in
[`pam_systemd`](https://www.freedesktop.org/software/systemd/man/pam_systemd.html)
@@ -744,7 +755,7 @@ that may be used in this section are identical to the equally named ones in the
`regular` section (i.e. at the top-level object). Specifically, these are:
`iconName`, `location`, `shell`, `umask`, `environment`, `timeZone`,
-`preferredLanguage`, `niceLevel`, `resourceLimits`, `locked`, `notBeforeUSec`,
+`preferredLanguage`, `additionalLanguages`, `niceLevel`, `resourceLimits`, `locked`, `notBeforeUSec`,
`notAfterUSec`, `storage`, `diskSize`, `diskSizeRelative`, `skeletonDirectory`,
`accessMode`, `tasksMax`, `memoryHigh`, `memoryMax`, `cpuWeight`, `ioWeight`,
`mountNoDevices`, `mountNoSuid`, `mountNoExecute`, `cifsDomain`,