Skip to content

Conversation

@speco29
Copy link
Contributor

@speco29 speco29 commented Aug 7, 2025

Description of Changes

@OriolAbril @kamila-NF
Narrates how can maintainers setup the CLI setup of Transifex and push and pull Translations

Related Issue

Type of Change

Please check the appropriate box that describes your PR:

  • 🐛 Bug Fix — Fixes a documented issue or incorrect behavior
  • ✨ Content Enhancement — Updates or improves existing content
  • ✍️ New Content — Adds new chapters, examples, or significant sections
  • 🛠️ Other — Please describe in the Description of Changes section

Additional Notes (Optional)

Checklist

@netlify
Copy link

netlify bot commented Aug 7, 2025

Deploy Preview for stupendous-kringle-a86e81 ready!

Name Link
🔨 Latest commit 00cf9ac
🔍 Latest deploy log https://app.netlify.com/projects/stupendous-kringle-a86e81/deploys/68ad9dc0bf859100085ef89f
😎 Deploy Preview https://deploy-preview-371--stupendous-kringle-a86e81.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Translation.md Outdated
Comment on lines 57 to 59
Download the latest Go-based CLI from the [Transifex CLI releases](https://github.com/transifex/cli/releases).

Place the binary in a folder like ```C:\tx-cli``` and add it to your system’s PATH.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to the transifex website for the install instructions. Copying these over here makes them windows only and they could also become outdated more easily. I would instead link to the transifex instructions and then show how to verify the install was successful

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the changes, you can review it;)

Translation.md Outdated

## Syncing with Transifex

We use Transifex as our translation service for the Cookbook, in order to collaborate on translations via Transifex, follow these steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would restrucuture the wording and sections around this. I think the vast majority of cases will/should not follow all these steps. I would instead focus on what each step does and when it should be executed. i.e. when a new page/chapter is added to the cookbook we need to add it to .tx/config, when we do any update to the content we need to regenerate source files via sphinx gettext and sphinx-intl then both open a PR with that and push to transifex (that includes the previous case when a new chapter is added but also updates to existing chapters), then at some other point (iiuc 100% manually) we need to pull translations from transifex so they make it into the published website

Translation.md Outdated

### Step 2: Authenticate with Transifex

Create a ```.transifexrc``` file in your home directory ```(C:\Users\<yourname>\)``` with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also link to the official documentation on authenticating

Translation.md Outdated
Get your token from [Transifex Account Settings](https://app.transifex.com/user/settings/api/).


### Step 3: Configure ```.tx/config```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think is will be needed ever again, covering adding more resources or deleting resources from it is probably fine. Again, I'd recommend using tx client for adding/deleting, and linking to the official docs even if we add the command in here.

Translation.md Outdated
Comment on lines 97 to 105
To upload updated source files to Transifex:
```
tx push -s
```

To push translation files:
```
tx push -t
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't come up with any scenario where we'd want one of those but not the other. Can we use tx push -s -t all at once? Or explain when we'd want to use one without the other?

Translation.md Outdated
- Run ```tx status``` to check resource sync.
- Use ```tx config discovery``` to auto-detect new files.

### Need help? Reach out to the maintainers or open an issue!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target audience for this document will be the ones that will know the most about transifex and translations. I am not sure this is helpful in this situation

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is useful

Translation.md Outdated
### Step 5: Pull Translations
To download all available translations:
```
tx pull -a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am adding translations on transifex right now and will review some but not others. Please make sure the command we add here pulls only reviewed translations but not translated but unreviewed content.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added 4 translated+reviewed strings and 4 translated but not reviewed (the content of those strings says in English "This string is translated but not reviewed and should not be pulled from transifex") so you can easily check which way of pulling gets only reviewed content.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check this

@kamilastep
Copy link

I'm not sure what should I test here.

@speco29 speco29 changed the title Add Transifex setup for maintainers in Translation.md Add Transifex setup guide for maintainers in Translation.md Aug 21, 2025
Translation.md Outdated
### Step 5: Pulling Translations
To fetch updated translations from Transifex (done manually before publishing):
```
tx pull -a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this command in #368 and it downloads unreviewed translations. It needs to be:

Suggested change
tx pull -a
tx pull -a -m reviewed

Translation.md Outdated
Comment on lines 100 to 103
After updating content or adding new chapters:
- Regenerate ```.po``` files using ```sphinx-gettext``` and ```sphinx-intl```.
- Open a PR with the updated files.
- Push to Transifex:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the call after @kamila-NF feedback we decided to do these steps only when a release is made, not every time a change is made

Translation.md Outdated
Comment on lines 81 to 82
- Adding a new chapter or page to the Cookbook
- Removing or renaming existing translation files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the call after @kamila-NF feedback we decided to do these steps only when a release is made, not every time a change is made

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command to build the translated version of the website also needs to be updated. Given we need to preprocess things in conf.py using the value of language we can't use -D anymore. Change:

# from sphinx-build -D language=<language-code> -b html DISCOVER/ DISCOVER/_build/html
# to
WEBSITE_LANGUAGE=<language-code> sphinx-build -b html DISCOVER/ DISCOVER/_build/html

when running sphinx-build first conf.py gets executed and then all the configuration values that have been defined from executing it are passed to the sphinx class that builds the website. -D option modifies the configuration values, but it does so after executing conf.py. This means that things like current_language_name = next((lang['name_local'] for lang in all_languages if lang['code'] == language), language) get executed with language set to the default instead of the variable passed through -D option

@speco29 speco29 marked this pull request as ready for review August 26, 2025 17:17
@speco29
Copy link
Contributor Author

speco29 commented Aug 27, 2025

@OriolAbril I have made the changes you suggested, is their anything else to change/add?

Copy link
Contributor

@OriolAbril OriolAbril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, leaving it up for @kamila-NF, @aterrel or @emmasaroyan to click merge after another quick review on their end

@OriolAbril OriolAbril merged commit 8dc48e8 into numfocus:main Sep 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants