dev

For i18n on Fandom Developers Wiki, see Project:I18n.

The term i18n means internationalization - the separation of UI and content locale. Web developers apply i18n to their userscripts, to ensure the following:

  1. scripts will scale to Fandom's locale ranges
  2. scripts can be adapted to different languages and regions

Internationalisation is followed by script localization (numeronym: l10n) - the addition of locale-specific content into the UI.

Locale

The locale is a language and region parameter that defines the user's preference. On Fandom, wikis have set language codes and users have a language preference to reflect their locale. These can also be overridden by the ?uselang URL parameter.

Internationalisation

i18n purpose

The goal of i18n is to adapt the underlying layout or UI logic in a script, so that it isn't locale specific. That makes it possible to accommodate locale-specific content down the line, like message translations.

In general however, locale differences could possibly change layout (reading direction) and measurement systems (metric and Imperial units), even though it is mostly important for translation on Fandom.

i18n process

The i18n process involves dividing content by locale, and storing it separately from the UI in the script. This improves the user experience for developers and content translators.

i18n benefits

There are benefits to i18n:

Localization

Purpose of l10n

The purpose of l10n is to ensure scripts are suitable for users from a specific locale. The I18n-js library has a message function that targets the user's locale automatically.

Note that l10n requires i18n, so that the UI is not partly or entirely fixed to the code author's language or region.

l10n process

The l10n process is longer than i18n - content is extended to fit a new locale, mainly through message translation. This is usually done through editing JSON or individual system messages.

Benefits of l10n

Here are some benefits to l10n:

See also

Text above can be found here (edit)