You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://github.com/scientific-python-translations. To get you started with the project
36
+
repository we provide a [translations-cookiecutter](https://github.com/Scientific-Python-Translations/translations-cookiecutter) template.
37
+
38
+
This template includes the necessary workflows that will run periodically to keep the infrastructure in sync. See [](#automation-details) for more information.
39
39
40
40
### Announce your project to potential translators
41
41
@@ -49,69 +49,149 @@ later.
49
49
You can find potential translators by reaching out in the `#translation` channel
50
50
on the [Scientific Python Discord server](https://discord.com/invite/vur45CbwMz).
51
51
52
-
### Merging translations
52
+
### Crowdin integration
53
53
54
54
As translators work on the Crowdin platform, a Pull Request is automatically
55
55
created in the project repository. This PR **should not** be merged, as it
56
56
contains all translations for all languages (see
57
-
[numpy/numpy.org#778](https://github.com/numpy/numpy.org/pull/778) for an
58
-
example). If your website is set up through the Scientific Python Translations
59
-
org, this PR will have the `do-not-merge` label applied to it.
60
-
61
-
After translations for a language are completed and ready to be deployed, you
62
-
should:
63
-
64
-
1. Go to the repository corresponding to your project's sources under
65
-
https://github.com/Scientific-Python-Translations
66
-
2. Go to the Actions tab
67
-
3. Manually trigger the "Create translations PR" workflow, with the language
68
-
code for your language of interest as input.
57
+
[Scientific-Python-Translations/scipy.org-translations#187](https://github.com/Scientific-Python-Translations/scipy.org-translations/pull/187) for an
58
+
example). This PR will be opened againts the translations repository (e.g. Scientific-Python-Translations/scipy.org-translations). If your website is set up throughthe Scientific Python Translations
59
+
org, this PR will should have the `do-not-merge` label applied to it to ensure the PR
60
+
will not be merged accidentally.
69
61
70
-
<center><imgalt="Screenshot of the Actions tab from GitHub, with the Create translations PR workflow highlighted."src="../images/create_translations.png"width=800/></center>
71
-
72
-
<center><imgalt="Screenshot of the Run workflow dialog from GitHub, with an input field labeled Crowding language code for the language of interest"src="../images/run_workflow.png"width=800/></center>
62
+
{{< admonition important >}}
63
+
To prevent future conflicts with the GitHub/Crowdin integration, it is important
64
+
that you configure Crowdin to have duplicate strings share the same translation.
65
+
To do this, navigate to your project's Settings in Crowdin, select Import and under
After these steps, a PR will be created to your website repo with the
75
-
translations for the language you selected (see
76
-
[numpy/numpy.org#774](https://github.com/numpy/numpy.org/pull/774) for an example.) This PR should be
77
-
merged when you are ready to publish the translations.
68
+
<center><imgalt="Screenshot of the Crowdin Settings showing the 'Hide (regular detection)' option."src="../images/duplicate_strings.png"width=800/></center>
78
69
79
-
### Cleaning up
70
+
{{< /admonition >}}
80
71
81
-
After merging the translations PR, the Crowdin service branch (by default, named `l10n_main`) will have merge conflicts with `main`. To fix this, delete the Crowdin service branch. Crowdin will automatically recreate the service branch with merge conflicts resolved. This same process can also be used to resolve merge conflicts if translations are updated outside of Crowdin.
82
72
83
73
## Automation details
84
74
85
-
Once a GitHub repository has been synced to Crowdin using the Scientific Python
When prompted, enter the details for your project (e.g. project name, organization, base branch). The structure will include necessary metadata, content folders, and pre-commit configuration. See the [Cookiecutter repository](https://github.com/Scientific-Python-Translations/translations-cookiecutter) for more information.
94
+
95
+
### Sync content from the source repo
96
+
97
+
The [`sync_content.yml` github workflow](https://github.com/Scientific-Python-Translations/translations-cookiecutter/blob/main/%7B%7Bcookiecutter.__translations_repo_name%7D%7D/.github/workflows/sync_content.yml) is in charge of keeping the **original source content** in sync with the translations repository within the Scientific Python Translations organization.
98
+
99
+
This workflow uses the `content-sync`[Github action](https://github.com/Scientific-Python-Translations/content-sync).
# These are provided by the Scientific Python Project and allow
123
+
# automation with bots
124
+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
125
+
passphrase: ${{ secrets.PASSPHRASE }}
126
+
token: ${{ secrets.TOKEN }}
127
+
```
128
+
129
+
This ensures your translation repo always has the latest source material in English (the chosen source language). If the source content has changed since the latest workflow run,
130
+
the translations bot will automatically create a Pull Request with signed commits and merge it automatically.
131
+
132
+
### Pull translations from Crowdin
133
+
134
+
The [`sync_translations.yml` github workflow](https://github.com/Scientific-Python-Translations/translations-cookiecutter/blob/main/%7B%7Bcookiecutter.__translations_repo_name%7D%7D/.github/workflows/sync_translations.yml) is in charge of keeping the **translated content** in sync with the translations repository within the Scientific Python Translations organization.
135
+
136
+
This workflow uses the `translations-sync` [Github action](https://github.com/Scientific-Python-Translations/translations-sync).
In the Crowdin interface, source strings are _translated_ and then _approved_ (which means a second translator has reviewed and approved the translation of this source string). Everytime this workflow runs, the translations bot will check for the available languages and check if they meet the translation percentage (90% by default) and approval percentage (0% by default). For every language that passes the criteria, which can be defined by the project mainatiners, a new Pull Request with signed commits will be created in the translations repository and the source repository.
173
+
174
+
To gather information on translators, an additional Pull Request will be created on the translations repository with a `translators.yml` file that lists the details such as username, fullname and avatar from the crowdin site.
175
+
176
+
All Pull Requests created by the Automations Bot on the translation repositories will be automatically merged.
90
177
91
-
1. Crowdin will keep commits for all the available languages under translation
92
-
in the same branch. However, we prefer to be able to create pull requests for
93
-
one language at a time to keep Pull Request reviews smaller and easier to manage.
178
+
### Cleaning up
94
179
95
-
2. There are times when translations must be edited manually (outside of
96
-
Crowdin) due to incorrect segmentation of the content into strings for
97
-
translation. Crowdin's branch can only be edited through the Crowdin UI, and
98
-
commits pushed to it outside of Crowdin will be lost when the branch is
99
-
synced. By creating a new branch with only the commits we are interested in,
100
-
we can bypass this limitation.
180
+
After merging the translations PR, the Crowdin service branch (by default, named `l10n_main`) may have merge conflicts with `main`. To fix this, delete the Crowdin service branch. Crowdin will automatically recreate the service branch with merge conflicts resolved. This same process can also be used to resolve merge conflicts if translations are updated outside of Crowdin.
101
181
102
-
Ideally you will **not** have to run the `create_branch_for_language.sh` script
103
-
directly, but can include it as part of your website deployment process (see,
104
-
for example, [numpy/numpy.org#772](https://github.com/numpy/numpy.org/pull/772))
182
+
### The translations bot
105
183
106
-
{{< admonition important >}}
107
-
To prevent future conflicts with the GitHub/Crowdin integration, it is important
108
-
that you configure Crowdin to have duplicate strings share the same translation.
109
-
To do this, navigate to your project's Settings in Crowdin, select Import and under
<center><imgalt="Screenshot of the Crowdin Settings showing the 'Hide (regular detection)' option."src="../images/duplicate_strings.png"width=800/></center>
187
+
Make sure to grant the bot appropriate repository permissions and exempt it from branch protection rules if needed.
113
188
114
-
{{< /admonition >}}
189
+
### 📚 Additional resources
190
+
191
+
- [How to Translate Content](https://scientific-python-translations.github.io/translate/)
0 commit comments