Skip to content

Language_Selection

Nicholas K. Dionysopoulos edited this page Dec 4, 2023 · 1 revision

Language selection in the web interface

The language selection code in Panopticon uses two source of information. From highest to lowest priority they are:

  • The currently logged-in user's language preference.
  • The browser's language preferences.

If there is a logged-in user, and they have chosen a preferred language this is what will be used. An explicit selection here ends the discussion.

If there is no logged-in user, or they have not selected a specific preferred language, Panopticon checks the language preferences conveyed by the browser through the Accept-Language HTTP header. This header usually includes a number of languages, with “weight factors” (0 to 1, the higher it is, the more preferred that language is). Panopticon tries to see if a translation in this language exists. If the browser specified a language without a country (e.g. en for English, as opposed to en-GB for English, Great Britain) Panopticon will pick the first language file which matches the country, even though it might not be exactly what the user expected. For example, a Canadian user who has selected “French” as their preferred language, instead of “French (Canada)”, might get the “French (France)” translation, despite the subtle differences in the two dialects.

If the user's language preferences cannot be fulfilled, Panopticon falls back to its main language: English (Great Britain).

Language selection in email messages

The selection works similarly to the web interface, using two sources of information. From highest to lowest priority they are:

  • The recipient's language preference
  • The application language preference

If the recipient is a user known to Panopticon, it will use their preferred language as long as an email template for that specific language exists.

Otherwise, Panopticon will use the default application language selected in the System Configuration page as long as an email template for that specific language exists.

In case an email template / language is still not found, Panopticon falls back to the email template with its language preference set to “(All)”, using the English (Great Britain) language. Please note that this will always be the case for CC'ed email addresses.

Partial translations and language management

Not all translations are 100% complete. This is normal, and expected.

Panopticon back-fills the untranslated string using its main language, English (Great Britain). This means that when you are using a language file with an incomplete translation you might find several strings displayed in British English instead of your chosen language. This is not a bug, it's a feature. It ensures that you will not see incomprehensible, untranslated language keys when using a language file which does not contain a complete translation.

Clone this wiki locally