1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
=====================
Cross-channel Content
=====================
When creating the actual content, there's a number of questions to answer.
#. Where to take content from?
#. Which content to take?
#. Where to put the content?
#. What to put into each file?
Content Sources
---------------
The content of each revision in ``gecko-strings`` corresponds to a given
revision in each original repository. For example, we could have
+------------------+--------------+
| Repository | Revision |
+==================+==============+
| mozilla-central | 4c92802939c1 |
+------------------+--------------+
| mozilla-beta | ace4081e8200 |
+------------------+--------------+
| mozilla-release | 2cf08fbb92b2 |
+------------------+--------------+
| mozilla-esr68 | 2cf9e0c91d51 |
+------------------+--------------+
| comm-central | 3f3fc2c0d804 |
+------------------+--------------+
| comm-beta | f95a6f4408a3 |
+------------------+--------------+
| comm-release | dc2694f035fa |
+------------------+--------------+
| comm-esr68 | d05d4d87d25c |
+------------------+--------------+
The assumption is that there's no content that's shared between ``mozilla-*`` and
``comm-*``, so we can just convert one repository and its branches at a time.
Covered Content
---------------
Which content is included in ``gecko-strings`` is
controlled by the project configurations of each product, on each branch.
Currently, those are :file:`browser/locales/l10n.toml` and
:file:`mobile/android/locales/l10n.toml` in ``mozilla-central``.
Created Content Structure
-------------------------
The created content is laid out in the directory in the same structure as
the files in ``l10n-central``. The localizable files end up like this:
.. code-block:: text
browser/
browser/
browser.ftl
chrome/
browser.properties
toolkit/
toolkit/
about/aboutAbout.ftl
This matches the file locations in ``mozilla-central`` with the
:file:`locales/en-US` part dropped.
The project configuration files are also converted and added to the
created file structure. As they're commonly in the :file:`locales` folder
which we strip, they're added to the dedicated :file:`_configs` folder.
.. code-block:: bash
$ ls _configs
browser.toml devtools-client.toml devtools-shared.toml
mobile-android.toml toolkit.toml
L10n File Contents
------------------
Let's assume we have a file to localize in several revisions with different
content.
== ======= ==== =======
ID central beta release
== ======= ==== =======
a one one one
b two two
c three
d four old old
== ======= ==== =======
The algorithm then creates content, taking localizable values from the left-most
branch, where *central* overrides *beta*, and *beta* overrides *release*. This
creates content as follows:
== =======
ID content
== =======
a one
b two
c three
d four
== =======
If a file doesn't exist in one of the revisions, that revision is dropped
from the content generation for this particular file.
.. note::
The example of the forth string here highlights the impact that changing
an existing string has. We ship one translation of *four* to central,
beta, and release. That's only a good idea if it doesn't matter which of the
two versions of the English copy got translated.
Project configurations
----------------------
The TOML files for project configuration are processed, but not unified
across branches at this point.
.. note::
The content of the ``-central`` branch determines what's localized
from ``gecko-strings``. Thus that TOML file needs to include all
directories across all branches for now. Removing entries requires
that the content is obsolete on all branches in cross-channel.
|