Bug 1804404 - Update l10n documentation due to DTD & .inc removal. r=flod

Differential Revision: https://phabricator.services.mozilla.com/D164047
This commit is contained in:
Eemeli Aro
2022-12-07 11:50:39 +00:00
parent 64a0467eb0
commit 3d25e4614a
7 changed files with 19 additions and 31 deletions

View File

@@ -32,11 +32,11 @@ Content
Locale Locale
Localizable applications keep all their localized information in Localizable applications keep all their localized information in
locale providers. This allows translators to plug in a different locale providers and Fluent FTL files, which are handled separately.
This allows translators to plug in a different
chrome package to translate an application without altering the rest chrome package to translate an application without altering the rest
of the source code. The two main types of localizable files are of the source code. In a chrome provider, localizable files are mostly
`DTD` files and Java-style properties Java-style properties files.
files.
Skin Skin
A skin provider is responsible for providing a complete set of files A skin provider is responsible for providing a complete set of files
that describe the visual appearance of the chrome. Typically a skin that describe the visual appearance of the chrome. Typically a skin

View File

@@ -260,16 +260,11 @@ The following file formats are known to the l10n tool chains:
Fluent Fluent
Used in Firefox UI, both declarative and programmatically. Used in Firefox UI, both declarative and programmatically.
DTD
Deprecated. Used in XUL and XHTML.
Properties Properties
Used from JavaScript and C++. When used from js, also comes with Used from JavaScript and C++. When used from js, also comes with
`plural support <https://developer.mozilla.org/docs/Mozilla/Localization/Localization_and_Plurals>`_. plural support (avoid if possible).
ini ini
Used by the crashreporter and updater, avoid if possible. Used by the crashreporter and updater, avoid if possible.
inc
Used during builds, for example to create metadata for
language packs or bookmarks.
Adding new formats involves changing various different tools, and is strongly Adding new formats involves changing various different tools, and is strongly
discouraged. discouraged.
@@ -291,12 +286,11 @@ a ``key``, and an action. An example like
.. code-block:: toml .. code-block:: toml
[[filters]] [[filters]]
path = "{l}browser/defines.inc" path = "{l}calendar/chrome/calendar/calendar-event-dialog.properties"
key = "MOZ_LANGPACK_CONTRIBUTORS" key = "re:.*Nounclass[1-9].*"
action = "ignore" action = "ignore"
indicates that the ``MOZ_LANGPACK_CONTRIBUTORS`` in ``browser/defines.inc`` indicates that the matching messages in ``calendar-event-dialog.properties`` are optional.
is optional.
For the legacy ini configuration files, there's a Python module For the legacy ini configuration files, there's a Python module
``filter.py`` next to the main ``l10n.ini``, implementing :py:func:`test`, with the following ``filter.py`` next to the main ``l10n.ini``, implementing :py:func:`test`, with the following
@@ -359,7 +353,7 @@ As part of the build and other localization tool chains, we run a variety
of source-based checks. Think of them as linters. of source-based checks. Think of them as linters.
The suite of checks is usually determined by file type, i.e., there's a The suite of checks is usually determined by file type, i.e., there's a
suite of checks for DTD files and one for properties files, etc. suite of checks for Fluent files and one for properties files, etc.
Localizations Localizations
------------- -------------

View File

@@ -297,7 +297,7 @@ Literals
~~~~~~~~ ~~~~~~~~
Use ``\uXXXX`` unicode escapes for non-ASCII characters. The character Use ``\uXXXX`` unicode escapes for non-ASCII characters. The character
set for XUL, DTD, script, and properties files is UTF-8, which is not easily set for XUL, script, and properties files is UTF-8, which is not easily
readable. readable.

View File

@@ -115,7 +115,7 @@ Things that are supported
------------------------- -------------------------
- Modifying JavaScript, (X)HTML, and CSS resources; and string - Modifying JavaScript, (X)HTML, and CSS resources; and string
properties and DTD and FTL files. properties and FTL files.
- Modifying Android Java code, resources, and strings. - Modifying Android Java code, resources, and strings.
- Running mochitests and xpcshell tests. - Running mochitests and xpcshell tests.
- Modifying ``Scalars.yaml`` to add Scalar Telemetry (since {{ - Modifying ``Scalars.yaml`` to add Scalar Telemetry (since {{

View File

@@ -16,9 +16,6 @@ L10N Glossary
L10n L10n
*Numeronym* for Localization, *L*, 10 chars, *n* *Numeronym* for Localization, *L*, 10 chars, *n*
L12y
Numeronym for Localizability
l10n-merge l10n-merge
nick-name for the process of merging ``en-US`` and a particular nick-name for the process of merging ``en-US`` and a particular
localization into one joint artifact without any missing strings, and localization into one joint artifact without any missing strings, and

View File

@@ -18,7 +18,7 @@ would have the adverse effect of forcing contributors to localize hundreds of
strings from scratch. strings from scratch.
`Fluent Migration`_ is a Python library designed to solve this specific problem: `Fluent Migration`_ is a Python library designed to solve this specific problem:
it allows to migrate legacy translations from `.dtd` and `.properties` files, it allows to migrate translations from `.properties` and other legacy file formats,
not only moving strings and transforming them as needed to adapt to the `FTL` not only moving strings and transforming them as needed to adapt to the `FTL`
syntax, but also replicating "blame" for each string in VCS. syntax, but also replicating "blame" for each string in VCS.
@@ -47,7 +47,6 @@ Dont hesitate to reach out to the l10n-drivers for feedback, help to test or
write the migration recipes: write the migration recipes:
- Francesco Lodolo (:flod) - Francesco Lodolo (:flod)
- Zibi Braniecki (:gandalf)
- Eemeli Aro (:eemeli) - Eemeli Aro (:eemeli)
.. _Fluent: http://projectfluent.org/ .. _Fluent: http://projectfluent.org/

View File

@@ -166,8 +166,7 @@ preferred over short identifiers like :js:`ok` or :js:`ok-button`.
Localization Systems Localization Systems
==================== ====================
Gecko has three main localization systems: Fluent and two legacy systems, Gecko has two main localization systems: Fluent and StringBundle, a legacy system.
DTD and StringBundle.
Fluent Fluent
------ ------
@@ -181,19 +180,18 @@ features including good internationalization model and strong bidirectionality s
To learn more about Fluent, follow the `Fluent for Firefox Developers`_ guide. To learn more about Fluent, follow the `Fluent for Firefox Developers`_ guide.
DTD & StringBundle StringBundle
------------------ ------------
DTD are deprecated, but still used for XUL and XHTML file localization. It uses `.dtd` files
and the only localization feature it provides is the ability to reference one
string from another via entity reference.
StringBundle is a runtime API used primarily for localization of C++ code. StringBundle is a runtime API used primarily for localization of C++ code.
The messages are stored in `.properties` files and loaded using the StringBundle API The messages are stored in `.properties` files and loaded using the StringBundle API
and then retrieved from there via imperative calls. and then retrieved from there via imperative calls.
The system provides external arguments which can be placed into the string, and The system provides external arguments which can be placed into the string, and
support basic plural categories via a proprietary API `PluralForms.jsm`. supports basic plural categories via a proprietary API `PluralForm.sys.mjs`.
Adding new StringBundle messages should only be done after serious consideration,
and in particular any new use of PluralForm messages should be avoided.
.. _Pontoon: https://pontoon.mozilla.org/ .. _Pontoon: https://pontoon.mozilla.org/
.. _hg.mozilla.org/l10n-central: https://hg.mozilla.org/l10n-central/ .. _hg.mozilla.org/l10n-central: https://hg.mozilla.org/l10n-central/