Skip to content

Commit 54958cf

Browse files
authored
Merge pull request ceph#63285 from afreen23/wip-71293-tentacle
tentacle: mgr/dashboard: deprecate `transifex-i18ntool` and support transifex cli Reviewed-by: Afreen Misbah <[email protected]> Reviewed-by: Anthony D Atri <[email protected]>
2 parents 763ee17 + fd3522a commit 54958cf

File tree

17 files changed

+23471
-5929
lines changed

17 files changed

+23471
-5929
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:tentacle]
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 = Tentacle
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"

src/pybind/mgr/dashboard/frontend/src/locale/messages.cs.xlf

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@
310310
</context-group>
311311
<context-group purpose="location">
312312
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
313-
<context context-type="linenumber">38</context>
313+
<context context-type="linenumber">39</context>
314314
</context-group>
315315
<context-group purpose="location">
316316
<context context-type="sourcefile">src/app/ceph/smb/smb-tabs/smb-tabs.component.html</context>
@@ -2113,7 +2113,7 @@
21132113
</context-group>
21142114
<context-group purpose="location">
21152115
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
2116-
<context context-type="linenumber">32</context>
2116+
<context context-type="linenumber">33</context>
21172117
</context-group>
21182118
<context-group purpose="location">
21192119
<context context-type="sourcefile">src/app/ceph/block/nvmeof-tabs/nvmeof-tabs.component.html</context>
@@ -2498,7 +2498,7 @@
24982498
</context-group>
24992499
<context-group purpose="location">
25002500
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts</context>
2501-
<context context-type="linenumber">71</context>
2501+
<context context-type="linenumber">69</context>
25022502
</context-group>
25032503
<context-group purpose="location">
25042504
<context context-type="sourcefile">src/app/ceph/cluster/hosts/hosts.component.ts</context>
@@ -2965,23 +2965,23 @@
29652965
<context context-type="linenumber">152</context>
29662966
</context-group>
29672967
</trans-unit>
2968-
<trans-unit id="f5ff2607cf2fd0645a263371d6f93f063d07e33a" datatype="html">
2969-
<source>Enter group</source>
2968+
<trans-unit id="cf378a96424886fda41c2c758e3996513692cd54" datatype="html">
2969+
<source>Selected Gateway Group</source>
29702970
<context-group purpose="location">
29712971
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
2972-
<context context-type="linenumber">10</context>
2972+
<context context-type="linenumber">8</context>
29732973
</context-group>
29742974
<context-group purpose="location">
29752975
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html</context>
2976-
<context context-type="linenumber">10</context>
2976+
<context context-type="linenumber">8</context>
29772977
</context-group>
29782978
</trans-unit>
29792979
<trans-unit id="3cc9c2ae277393b3946b38c088dabff671b1ee1b" datatype="html">
29802980
<source>Performance</source>
29812981
<target>Výkonnost</target>
29822982
<context-group purpose="location">
29832983
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
2984-
<context context-type="linenumber">44</context>
2984+
<context context-type="linenumber">45</context>
29852985
</context-group>
29862986
<context-group purpose="location">
29872987
<context context-type="sourcefile">src/app/ceph/block/rbd-details/rbd-details.component.html</context>
@@ -2996,36 +2996,47 @@
29962996
<source> Gateways <x id="START_TAG_CD_HELP_TEXT" ctype="x-cd_help_text" equiv-text="&lt;cd-help-text&gt;"/> Ceph NVMe-oF gateways provide Ceph Block Device storage through NVMe/TCP. For VMware clients the NVMe/TCP volumes display as VMFS Datastores. For Linux clients the NVMe/TCP volumes display as as block devices. <x id="CLOSE_TAG_CD_HELP_TEXT" ctype="x-cd_help_text" equiv-text="&lt;/cd-help-text&gt;"/></source>
29972997
<context-group purpose="location">
29982998
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
2999-
<context context-type="linenumber">53,57</context>
2999+
<context context-type="linenumber">54,58</context>
30003000
</context-group>
30013001
</trans-unit>
30023002
<trans-unit id="88d52a108e372081c5e122c5b369aac3ec904146" datatype="html">
30033003
<source>Gateway overview</source>
30043004
<context-group purpose="location">
30053005
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
3006-
<context context-type="linenumber">69</context>
3006+
<context context-type="linenumber">70</context>
30073007
</context-group>
30083008
</trans-unit>
30093009
<trans-unit id="9517e7f935e73e6889dda20c0fa0408465c18f2e" datatype="html">
30103010
<source>Gateway performance</source>
30113011
<context-group purpose="location">
30123012
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.html</context>
3013-
<context context-type="linenumber">79</context>
3013+
<context context-type="linenumber">80</context>
3014+
</context-group>
3015+
</trans-unit>
3016+
<trans-unit id="5032690935748986815" datatype="html">
3017+
<source>Enter group name</source>
3018+
<context-group purpose="location">
3019+
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts</context>
3020+
<context context-type="linenumber">25</context>
3021+
</context-group>
3022+
<context-group purpose="location">
3023+
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts</context>
3024+
<context context-type="linenumber">20</context>
30143025
</context-group>
30153026
</trans-unit>
30163027
<trans-unit id="7974613004081450726" datatype="html">
30173028
<source>Gateway ID</source>
30183029
<context-group purpose="location">
30193030
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts</context>
3020-
<context context-type="linenumber">67</context>
3031+
<context context-type="linenumber">65</context>
30213032
</context-group>
30223033
</trans-unit>
30233034
<trans-unit id="5611592591303869712" datatype="html">
30243035
<source>Status</source>
30253036
<target>Stav</target>
30263037
<context-group purpose="location">
30273038
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts</context>
3028-
<context context-type="linenumber">75</context>
3039+
<context context-type="linenumber">73</context>
30293040
</context-group>
30303041
<context-group purpose="location">
30313042
<context context-type="sourcefile">src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts</context>
@@ -3060,6 +3071,17 @@
30603071
<context context-type="linenumber">71</context>
30613072
</context-group>
30623073
</trans-unit>
3074+
<trans-unit id="3107044384926915007" datatype="html">
3075+
<source>No groups available</source>
3076+
<context-group purpose="location">
3077+
<context context-type="sourcefile">src/app/ceph/block/nvmeof-gateway/nvmeof-gateway.component.ts</context>
3078+
<context context-type="linenumber">134</context>
3079+
</context-group>
3080+
<context-group purpose="location">
3081+
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts</context>
3082+
<context context-type="linenumber">148</context>
3083+
</context-group>
3084+
</trans-unit>
30633085
<trans-unit id="4f7cdf99e53b74c843abea60b5ca07a6842c9135" datatype="html">
30643086
<source>Hosts </source>
30653087
<context-group purpose="location">
@@ -3316,6 +3338,10 @@
33163338
<context context-type="sourcefile">src/app/ceph/block/nvmeof-listeners-form/nvmeof-listeners-form.component.ts</context>
33173339
<context context-type="linenumber">50</context>
33183340
</context-group>
3341+
<context-group purpose="location">
3342+
<context context-type="sourcefile">src/app/ceph/block/nvmeof-listeners-list/nvmeof-listeners-list.component.ts</context>
3343+
<context context-type="linenumber">103</context>
3344+
</context-group>
33193345
</trans-unit>
33203346
<trans-unit id="6641024648411549335" datatype="html">
33213347
<source>Host</source>
@@ -3356,6 +3382,13 @@
33563382
<context context-type="linenumber">81</context>
33573383
</context-group>
33583384
</trans-unit>
3385+
<trans-unit id="5236029444167617860" datatype="html">
3386+
<source>listener</source>
3387+
<context-group purpose="location">
3388+
<context context-type="sourcefile">src/app/ceph/block/nvmeof-listeners-list/nvmeof-listeners-list.component.ts</context>
3389+
<context context-type="linenumber">106</context>
3390+
</context-group>
3391+
</trans-unit>
33593392
<trans-unit id="e70fcca5a99575cffef3ff8cbd5e69f06ffd0f1c" datatype="html">
33603393
<source>Pool</source>
33613394
<target>Fond</target>
@@ -3800,28 +3833,28 @@
38003833
<source> Subsystems <x id="START_TAG_CD_HELP_TEXT" ctype="x-cd_help_text" equiv-text="&lt;cd-help-text&gt;"/> A subsystem provides access control to which hosts can access the namespaces within the subsystem. <x id="CLOSE_TAG_CD_HELP_TEXT" ctype="x-cd_help_text" equiv-text="&lt;/cd-help-text&gt;"/></source>
38013834
<context-group purpose="location">
38023835
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.html</context>
3803-
<context context-type="linenumber">18,22</context>
3836+
<context context-type="linenumber">19,23</context>
38043837
</context-group>
38053838
</trans-unit>
38063839
<trans-unit id="7707701592702091951" datatype="html">
38073840
<source>NQN</source>
38083841
<context-group purpose="location">
38093842
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts</context>
3810-
<context context-type="linenumber">61</context>
3843+
<context context-type="linenumber">59</context>
38113844
</context-group>
38123845
</trans-unit>
38133846
<trans-unit id="4249456376242514671" datatype="html">
38143847
<source># Namespaces</source>
38153848
<context-group purpose="location">
38163849
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts</context>
3817-
<context context-type="linenumber">65</context>
3850+
<context context-type="linenumber">63</context>
38183851
</context-group>
38193852
</trans-unit>
38203853
<trans-unit id="8636681982233006716" datatype="html">
38213854
<source># Maximum Allowed Namespaces</source>
38223855
<context-group purpose="location">
38233856
<context context-type="sourcefile">src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts</context>
3824-
<context context-type="linenumber">69</context>
3857+
<context context-type="linenumber">67</context>
38253858
</context-group>
38263859
</trans-unit>
38273860
<trans-unit id="409b6a23ac5c8302cbe2868c58d14eb425d72ddd" datatype="html">

0 commit comments

Comments
 (0)