-
Notifications
You must be signed in to change notification settings - Fork 0
Add script to pull Transifex translations #215
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
0883e33 to
8dcf17f
Compare
8dcf17f to
65a3cc0
Compare
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.
Pull Request Overview
This PR adds a script to automate pulling and processing translation files from Transifex for the iOS project. The script handles downloading translations, renaming locale directories to match iOS conventions, normalizing file formats, and cleaning up empty files. The Transifex configuration has been updated to work with iOS .strings files instead of JSON format.
Key changes:
- New bash script for automated translation management
- Updated Transifex configuration for iOS
.stringsformat - Mass updates to translation files across multiple languages
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/pull-translations.sh | New automation script for pulling and processing Transifex translations |
| README.md | Updated documentation with instructions for pulling translations |
| .tx/config | Simplified Transifex config to support iOS .strings format |
| *.lproj/Localizable.strings | Updated translation files across all supported languages |
| if awk '{ | ||
| gsub(/[[:space:]]+$/, "") | ||
| if ($0 ~ /^"[^"]*"[[:space:]]*=[[:space:]]*"";[[:space:]]*$/) next | ||
| }' "$file" > "$file.tmp"; then |
Copilot
AI
Nov 11, 2025
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 awk script embedded in the normalization step has complex regex logic without explanation. Add a comment describing what this pattern matches (empty string assignments) and why they are being removed.
| - Create a `.transifexrc` file in your home directory (`~/.transifexrc`) with your API token: | ||
| ```ini | ||
| [https://www.transifex.com] | ||
| rest_hostname = https://rest.api.transifex.com | ||
| token = YOUR_API_TOKEN_HERE | ||
| ``` | ||
| - You can get your API token from your [Transifex account settings](https://www.transifex.com/user/settings/api/) | ||
| - The CLI will prompt you for an API token if one is not configured | ||
|
|
Copilot
AI
Nov 11, 2025
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 documentation shows creating a .transifexrc file manually, but the modern Transifex CLI uses tx init and stores credentials differently. Consider updating the documentation to mention the recommended tx init approach or clarify that this is for legacy authentication.
| - Create a `.transifexrc` file in your home directory (`~/.transifexrc`) with your API token: | |
| ```ini | |
| [https://www.transifex.com] | |
| rest_hostname = https://rest.api.transifex.com | |
| token = YOUR_API_TOKEN_HERE | |
| ``` | |
| - You can get your API token from your [Transifex account settings](https://www.transifex.com/user/settings/api/) | |
| - The CLI will prompt you for an API token if one is not configured | |
| - **Recommended:** Run `tx init` and follow the prompts to authenticate with your API token: | |
| ```sh | |
| tx init | |
| ``` | |
| - You can get your API token from your [Transifex account settings](https://www.transifex.com/user/settings/api/) | |
| - The CLI will prompt you for an API token if one is not configured. | |
| > [!NOTE] | |
| > **Legacy/Advanced:** If you need to manually configure authentication (e.g., for CI or legacy workflows), you can create a `.transifexrc` file in your home directory (`~/.transifexrc`) with your API token: | |
| > ```ini | |
| > [https://www.transifex.com] | |
| > rest_hostname = https://rest.api.transifex.com | |
| > token = YOUR_API_TOKEN_HERE | |
| > ``` |
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 cli asks me the token every time I run the cript, tested setting on my home directory and in the root project 🤔
[https://app.transifex.com]
rest_hostname = https://rest.api.transifex.com
token = tokentext
[https://www.transifex.com]
rest_hostname = https://rest.api.transifex.com
token = tokentext
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 script worked for me, but it would be good to take a look at this copilot comment
Adds a script to pull the latest Android translation files from Transifex and adjust the folders and format to match the project.
Note: iOS strings were outdated, which is the reason for large updates in many of the strings files.