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
Родитель 01ab59b5a9
Коммит f08c01b802
7 изменённых файлов: 19 добавлений и 31 удалений

Просмотреть файл

@ -32,11 +32,11 @@ Content
Locale
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
of the source code. The two main types of localizable files are
`DTD` files and Java-style properties
files.
of the source code. In a chrome provider, localizable files are mostly
Java-style properties files.
Skin
A skin provider is responsible for providing a complete set of files
that describe the visual appearance of the chrome. Typically a skin

Просмотреть файл

@ -260,16 +260,11 @@ The following file formats are known to the l10n tool chains:
Fluent
Used in Firefox UI, both declarative and programmatically.
DTD
Deprecated. Used in XUL and XHTML.
Properties
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
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
discouraged.
@ -291,12 +286,11 @@ a ``key``, and an action. An example like
.. code-block:: toml
[[filters]]
path = "{l}browser/defines.inc"
key = "MOZ_LANGPACK_CONTRIBUTORS"
path = "{l}calendar/chrome/calendar/calendar-event-dialog.properties"
key = "re:.*Nounclass[1-9].*"
action = "ignore"
indicates that the ``MOZ_LANGPACK_CONTRIBUTORS`` in ``browser/defines.inc``
is optional.
indicates that the matching messages in ``calendar-event-dialog.properties`` are optional.
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
@ -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.
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
-------------

Просмотреть файл

@ -297,7 +297,7 @@ Literals
~~~~~~~~
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.

Просмотреть файл

@ -115,7 +115,7 @@ Things that are supported
-------------------------
- 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.
- Running mochitests and xpcshell tests.
- Modifying ``Scalars.yaml`` to add Scalar Telemetry (since {{

Просмотреть файл

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

Просмотреть файл

@ -18,7 +18,7 @@ would have the adverse effect of forcing contributors to localize hundreds of
strings from scratch.
`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`
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:
- Francesco Lodolo (:flod)
- Zibi Braniecki (:gandalf)
- Eemeli Aro (:eemeli)
.. _Fluent: http://projectfluent.org/

Просмотреть файл

@ -166,8 +166,7 @@ preferred over short identifiers like :js:`ok` or :js:`ok-button`.
Localization Systems
====================
Gecko has three main localization systems: Fluent and two legacy systems,
DTD and StringBundle.
Gecko has two main localization systems: Fluent and StringBundle, a legacy system.
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.
DTD & 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
------------
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
and then retrieved from there via imperative calls.
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/
.. _hg.mozilla.org/l10n-central: https://hg.mozilla.org/l10n-central/