Skip to content

Commit d7bd913

Browse files
committed
mgr/dashboard: deprecate transifex-i18ntool and support transifex cli
- transifex-i18ntool is no longer maintained - transifex officialy supports now a tool https://github.com/transifex/cli - doc update Fixes https://tracker.ceph.com/issues/71127 Signed-off-by: Afreen Misbah <[email protected]> (cherry picked from commit 25fa421)
1 parent 7248859 commit d7bd913

File tree

6 files changed

+22378
-5340
lines changed

6 files changed

+22378
-5340
lines changed

doc/dev/developer_guide/dash-devel.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,56 +1083,56 @@ All translations will then be reviewed and later pushed upstream.
10831083
Updating translated messages
10841084
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10851085

1086-
Any time there are new messages translated and reviewed in a specific language
1087-
we should update the translation file upstream.
1086+
1. Download the `transifex CLI tool <https://github.com/transifex/cli>`_
10881087

1089-
To do that, check the settings in the i18n config file
1090-
``src/pybind/mgr/dashboard/frontend/i18n.config.json``:: and make sure that the
1091-
organization is *ceph*, the project is *ceph-dashboard* and the resource is
1092-
the one you want to pull from and push to e.g. *Master:master*. To find a list
1093-
of available resources visit `<https://www.transifex.com/ceph/ceph-dashboard/content/>`_.
1088+
2. Create an `API token <https://www.transifex.com/user/settings/api/>`_.
10941089

1095-
After you checked the config go to the directory ``src/pybind/mgr/dashboard/frontend`` and run::
1090+
3. Pushing translation:
10961091

1097-
$ npm run i18n
1092+
$ tx push -s
10981093

1099-
This command will extract all marked messages from the HTML templates and
1100-
TypeScript files. Once the source file has been created it will push it to
1101-
transifex and pull the latest translations. It will also fill all the
1102-
untranslated strings with the source string.
1103-
The tool will ask you for an api token, unless you added it by running:
1094+
This will push the source file in transifex.
11041095

1105-
$ npm run i18n:token
1096+
4. Pulling translation:
11061097

1107-
To create a transifex api token visit `<https://www.transifex.com/user/settings/api/>`_.
1098+
$ tx pull -r ceph-dashboard.<resource_slug> -f
11081099

1109-
After the command ran successfully, build the UI and check if everything is
1110-
working as expected. You also might want to run the frontend tests.
1100+
e.g `tx pull -r ceph-dashboard.main`
1101+
1102+
This will pull all translations of the resource.
11111103

11121104
Add a new release resource to transifex
11131105
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11141106

11151107
In order to organize the translations, we create a
11161108
`transifex resource <https://www.transifex.com/ceph/ceph-dashboard/content/>`_
11171109
for every Ceph release. This means, once a new version has been released, the
1118-
``src/pybind/mgr/dashboard/frontend/i18n.config.json`` needs to be updated on
1110+
``src/pybind/mgr/dashboard/frontend/.tx/config`` needs to be updated on
11191111
the release branch.
11201112

11211113
Please replace::
1122-
1123-
"resource": "Master:master"
1114+
`resource_name = Main`
11241115

11251116
by::
1117+
`resource_name = <Release-name>`
1118+
1119+
E.g. the resource definition for the Tentacle release::
1120+
`resource_name = Tentacle`
11261121

1127-
"resource": "<Release-name>:<release-name>"
1122+
And replace::
1123+
`[o:ceph:p:ceph-dashboard:r:main]`
1124+
1125+
by::
1126+
`[o:ceph:p:ceph-dashboard:r:<release-name>]`
11281127

1129-
E.g. the resource definition for the pacific release::
1128+
E.g. the resource definition for the Tentacle release::
1129+
`[o:ceph:p:ceph-dashboard:r:tentacle]`
11301130

1131-
"resource": "Pacific:pacific"
1131+
Once done push the translations::
1132+
$ tx push -s
11321133

11331134
Note:
1134-
The first part of the resource definition (before the colon) needs to be
1135-
written with a capital letter.
1135+
Only the <Release-name> is capitalized.
11361136

11371137
Suggestions
11381138
~~~~~~~~~~~
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[main]
2+
host = https://app.transifex.com
3+
4+
[o:ceph:p:ceph-dashboard:r:main]
5+
file_filter = src/locale/messages.<lang>.xlf
6+
source_file = src/locale/messages.xlf
7+
type = XLIFF
8+
minimum_perc = 0
9+
resource_name = Main
10+
replace_edited_strings = false
11+
keep_translations = false
12+
lang_map = de_DE: de-DE, es_ES: es-ES, fr_FR: fr-FR, id_ID: id-ID, it_IT: it-IT, ja_JP: ja-JP, ko_KR: ko-KR, pl_PL: pl-PL, pt_BR: pt-BR, zh_CN: zh-CN, zh_TW: zh-TW

src/pybind/mgr/dashboard/frontend/i18n.config.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/pybind/mgr/dashboard/frontend/package-lock.json

Lines changed: 0 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pybind/mgr/dashboard/frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
"stylelint-config-sass-guidelines": "7.1.0",
139139
"stylelint-declaration-use-variable": "1.7.3",
140140
"table": "6.8.0",
141-
"transifex-i18ntool": "1.1.0",
142141
"ts-node": "9.0.0",
143142
"typescript": "5.4.5",
144143
"validator": "13.12.0"

0 commit comments

Comments
 (0)