<commit_before>.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, You can obtain one at http://mozilla.org/MPL/2.0/.

.. _l10n:

============
Localization
============

The site is fully localizable. Localization files are not shipped with the code
distribution, but are available in separate GitHub repositories. The proper repos
can be cloned and kept up-to-date using the ``l10n_update`` management command:

.. code-block:: console

    $ ./manage.py l10n_update

If you don't already have a ``locale`` directory, this command will clone the
git repo containing the .lang translation files (either the dev or prod files
depending on your ``DEV`` setting). If the folder is already present, it will
update the repository to the latest version. It do the same thing for the
repository for the .ftl translation files in ``data/www-l10n`` directory.

Fluent
======

Bedrock's Localization (l10n) system is based on `Project Fluent`_. This is a
departure from the legacy system (see below) that relied on a gettext work flow
of string extraction from template and code files, in that it relies on developers
directly editing the default language (English in our case) Fluent files and using
the string IDs created there in their templates and views.

The default files for the Fluent system live in the ``l10n`` directory in the root
of the bedrock project. This directory houses directories for each locale the developers
directly implement (mostly simplified English "en", and "en-US"). The simplified English
files are the default fallback for every string ID on the site and should be strings that
are plain and easy to understand English, as free from colloquialisms as possible. The
translators are able to easily understand the meaning of the string, and can then add their
own local flair to the ideas.<commit_msg>Update docs<commit_after>.. This Source Code Form is subject to the terms of the Mozilla Public
.. License, v. 2.0. If a copy of the MPL was not distributed with this
.. file, You can obtain one at http://mozilla.org/MPL/2.0/.

.. _l10n:

============
Localization
============

The site is fully localizable. Localization files are not shipped with the code
distribution, but are available in separate GitHub repositories. The proper repos
can be cloned and kept up-to-date using the ``l10n_update`` management command:

.. code-block:: console

    $ ./manage.py l10n_update

If you don't already have a ``data/locale`` directory, this command will clone the
git repo containing the .lang translation files (either the dev or prod files
depending on your ``DEV`` setting). If the folder is already present, it will
update the repository to the latest version. It do the same thing for the
repository for the .ftl translation files in ``data/www-l10n`` directory.

Fluent
======

Bedrock's Localization (l10n) system is based on `Project Fluent`_. This is a
departure from the legacy system (see below) that relied on a gettext work flow
of string extraction from template and code files, in that it relies on developers
directly editing the default language (English in our case) Fluent files and using
the string IDs created there in their templates and views.

The default files for the Fluent system live in the ``l10n`` directory in the root
of the bedrock project. This directory houses directories for each locale the developers
directly implement (mostly simplified English "en", and "en-US"). The simplified English
files are the default fallback for every string ID on the site and should be strings that
are plain and easy to understand English, as free from colloquialisms as possible. The
translators are able to easily understand the meaning of the string, and can then add their
own local flair to the ideas.
{'fraction_non_alphanumeric': 0.06736020806241873, 'fraction_numerical': 0.008322496749024707, 'mean_word_length': 4.364016736401673, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6364821', 'n_tokens_mistral': 1006, 'n_tokens_neox': 938, 'n_words': 588}