From d9e1d592e5f7074a5459875ef06a4d4841659ced Mon Sep 17 00:00:00 2001 From: Marco Bonelli Date: Wed, 21 Aug 2019 04:12:43 +0200 Subject: [PATCH] Client spec: clarify preferred page resolution method. --- CLIENT-SPECIFICATION.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CLIENT-SPECIFICATION.md b/CLIENT-SPECIFICATION.md index 9d2d2bf40..a1f1b65cb 100644 --- a/CLIENT-SPECIFICATION.md +++ b/CLIENT-SPECIFICATION.md @@ -185,6 +185,16 @@ The [`LANGUAGE` environment variable](https://www.gnu.org/software/gettext/manua The [`LC_MESSAGES` environment variable](https://www.gnu.org/software/gettext/manual/html_node/Locale-Environment-Variables.html) MAY be present. If the client itself is localized and this environment variable is present, it MUST use its value in order to determine the language in which interface text is shown (separately from the language used for pages). In absence of `LC_MESSAGES`, then `LANG` and `LANGUAGE` MUST be used for this purpose instead. +**Note that** it is highly RECOMMENDED to give precedence to the platform first, and then the language. In other words, look for a platform under each language, before falling back to the next preferred language. This ensures a meaningful and correct page resolution. + +Here's an example of how the lookup should be done on `linux` having set `LANGUAGE="it:fr:en"`: + + 1. pages.it/linux/some-page.md -> does not exist + 2. pages.fr/linux/some-page.md -> does not exist + 3. pages/linux/some-page.md -> does not exist + 4. pages.it/common/some-page.md -> does not exist + 5. pages.fr/common/some-page.md -> does not exist + 6. pages/common/some-page.md -> FOUND! Caching -------