-
-
Notifications
You must be signed in to change notification settings - Fork 227
Add Transifex setup guide for maintainers in Translation.md
#371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…R-Cookbook into translation-docs
…R-Cookbook into translation-docs
✅ Deploy Preview for stupendous-kringle-a86e81 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Translation.md
Outdated
| 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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``` |
There was a problem hiding this comment.
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
| To upload updated source files to Transifex: | ||
| ``` | ||
| tx push -s | ||
| ``` | ||
|
|
||
| To push translation files: | ||
| ``` | ||
| tx push -t | ||
| ``` |
There was a problem hiding this comment.
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! |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check this
|
I'm not sure what should I test here. |
Translation.mdTranslation.md
Translation.md
Outdated
| ### Step 5: Pulling Translations | ||
| To fetch updated translations from Transifex (done manually before publishing): | ||
| ``` | ||
| tx pull -a |
There was a problem hiding this comment.
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:
| tx pull -a | |
| tx pull -a -m reviewed |
Translation.md
Outdated
| 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: |
There was a problem hiding this comment.
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
| - Adding a new chapter or page to the Cookbook | ||
| - Removing or renaming existing translation files |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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/htmlwhen 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
|
@OriolAbril I have made the changes you suggested, is their anything else to change/add? |
OriolAbril
left a comment
There was a problem hiding this 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
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:
Additional Notes (Optional)
Checklist