Skip to content

Commit 8dc48e8

Browse files
authored
Add Transifex setup guide for maintainers in Translation.md (#371)
* Set up Transifex integration for translations * updation * updating translation.md * updating content and deleting files * add transifex setup for maintainers in Translation.md * Update Translation.md * updated the Translation.md according to feedback * update the guide according to feedback * remooves the `locales/en` and updates the guide * changes the file type from PO to markdown * updates the file according to feedback
1 parent cde1252 commit 8dc48e8

File tree

1 file changed

+69
-1
lines changed

1 file changed

+69
-1
lines changed

Translation.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Replace <language-code> with your target language (e.g., en, fr, de).
2323
Once .po files are updated, compile them to .mo for use in the built documentation:
2424

2525
```sh
26-
sphinx-build -D language=<language-code> -b html DISCOVER/ DISCOVER/_build/html
26+
WEBSITE_LANGUAGE=<language-code> sphinx-build -b html DISCOVER/ DISCOVER/_build/html
2727

2828
```
2929
After compiling, rebuild the book to see the translations applied:
@@ -44,4 +44,72 @@ DISCOVER/_build/html/index.html
4444
```
4545
and opening it in your browser.
4646

47+
4748
> Note: Contributors working on multilingual support should ensure .po file updates are included in commits.
49+
50+
51+
## Translation Workflow with Transifex
52+
53+
We use Transifex to manage translations for the DISCOVER Cookbook. This guide outlines when and how to interact with Transifex during development. You likely won’t need every step each time—focus on the ones relevant to your task.
54+
55+
### Step 1: Installing the Transifex CLI
56+
57+
Transifex provides a Go-based CLI for syncing translation files. Follow the (official installation instructions)[https://developers.transifex.com/docs/cli] for your operating system.
58+
59+
60+
Verify installation:
61+
```sh
62+
tx --version
63+
```
64+
Expected output:
65+
```
66+
TX CLient, version=1.6.x
67+
```
68+
69+
### Step 2: Authenticate with Transifex
70+
71+
To authenticate, create a ```.transifexrc``` file in your home directory. Refer to the [official authentication guide](https://developers.transifex.com/reference/api-authentication) for details.
72+
73+
74+
Get your token from [Transifex Account Settings](https://app.transifex.com/user/settings/api/).
75+
76+
77+
### Step 3: Updating ```.tx/config```
78+
79+
The ```.tx/config``` file maps source files to Transifex resources. You’ll only need to modify this whenever a new release is made:
80+
81+
Use the CLI to register new resources:
82+
```
83+
tx add \
84+
--organization numfocus \
85+
--project DISCOVER-Cookbook \
86+
--resource <resource_name> \
87+
--file-filter locales/<lang>/LC_MESSAGES/<filename>.po \
88+
--type PO \
89+
DISCOVER/_build/gettext/<filename>.pot
90+
```
91+
92+
Refer to the [Transifex CLI reference](https://developers.transifex.com/docs/cli) for more information.
93+
94+
95+
### Step 4: Pushing Source and Translation Files
96+
97+
Perform the following steps only when a release is made:
98+
- Regenerate ```.po``` files using ```sphinx-gettext``` and ```sphinx-intl```.
99+
- Open a PR with the updated files.
100+
- Push to Transifex:
101+
```
102+
tx push -s -t
103+
```
104+
105+
This uploads both source and translation files.
106+
107+
### Step 5: Pulling Translations
108+
To fetch updated translations from Transifex (done manually before publishing):
109+
```
110+
tx pull -a -m reviewed
111+
```
112+
113+
### Optional: Add Multiple Resources
114+
115+
To add multiplt resorces, use [CLI](https://developers.transifex.com/docs/cli) setup.

0 commit comments

Comments
 (0)