Skip to content

Commit aa1aadc

Browse files
authored
Merge pull request #12 from Scientific-Python-Translations/update/docs
Update docs
2 parents 486f3e5 + df1db97 commit aa1aadc

File tree

1 file changed

+72
-14
lines changed

1 file changed

+72
-14
lines changed

content/docs.md

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ jobs:
153153
- name: Sync Scipy translations
154154
uses: Scientific-Python-Translations/translations-sync@main
155155
with:
156-
# Provided by user
157156
crowdin-project: "scipy.org"
158157
source-repo: "scipy/scipy.org"
159158
source-path: "content/en/"
@@ -168,7 +167,8 @@ jobs:
168167
create-toml-file: "true"
169168
create-upstream-pr: "true"
170169
auto-merge: "true"
171-
# Provided by organization secrets
170+
# These are provided by the Scientific Python Project and allow
171+
# automation with bots
172172
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
173173
passphrase: ${{ secrets.PASSPHRASE }}
174174
token: ${{ secrets.TOKEN }}
@@ -183,7 +183,39 @@ All Pull Requests created by the Automations Bot on the translation repositories
183183

184184
### Cleaning up
185185

186-
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.
186+
After merging the translations PR, the Crowdin service branch (by default, named `l10n_main`) may have merge conflicts with `main`. To fix this, we used the `clean-up` Github action to delete the Crowdin service branch. Crowdin will automatically recreate the service branch with merge conflicts resolved. This Action will also delete any stale
187+
branches in the translations repository to keep things tidy.
188+
189+
### Example: Clean up SciPy translations repository
190+
191+
This workflow uses the `clean-up` [Github action](https://github.com/Scientific-Python-Translations/clean-up).
192+
193+
```yaml
194+
name: Clean Up
195+
196+
on:
197+
schedule:
198+
- cron: '0 0 * * FRI' # Every Fridat at midnight
199+
workflow_dispatch:
200+
201+
jobs:
202+
build:
203+
runs-on: ubuntu-latest
204+
steps:
205+
- name: Clean Scipy translations repository
206+
uses: Scientific-Python-Translations/clean-up@main
207+
env:
208+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
209+
with:
210+
translations-repo: "Scientific-Python-Translations/scipy.org-translations"
211+
translations-ref: "main"
212+
# These are provided by the Scientific Python Project and allow
213+
# automation with bots
214+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
215+
passphrase: ${{ secrets.PASSPHRASE }}
216+
token: "not-a-real-token"
217+
crowdin-token: ${{ secrets.CROWDIN_TOKEN }}
218+
```
187219

188220
### The translations bot
189221

@@ -192,28 +224,54 @@ All automations and pull requests are performed by:
192224

193225
Make sure to grant the bot appropriate repository permissions and exempt it from branch protection rules if needed.
194226

195-
### 📚 Additional resources
227+
## Preparing your project for internationalization and localization
196228

197-
- [How to Translate Content](https://scientific-python-translations.github.io/translate/)
198-
- [FAQ](https://scientific-python-translations.github.io/faq/)
199-
- [Crowdin Setup](https://crowdin.com/)
200-
- [Scientific Python Discord – `#translation`](https://scientific-python.org/community/)
229+
### Folder structure
230+
231+
This will depend on the framework you are using as many of these will provide solutions
232+
for localization. The principle is to have all files that have translatable content inside
233+
a folder named `en`. You can take a look at different examples from the following projects
234+
235+
#### Hugo using the Scientific Python theme
236+
237+
All translatable content is stored in `content/en/`
238+
239+
- [scipy](https://github.com/scipy/scipy.org/)
240+
- [numpy](https://github.com/numpy/numpy.org/)
201241

202-
## Setting up a language switcher
242+
#### NextJs with Babel and Lingui
203243

204-
This work is in progress - follow (issue #) for details.
244+
On this project the content is stored in `src/locales/en/`
205245

206-
### Scientific Python Hugo Theme
246+
- [Xarray](https://github.com/xarray-contrib/xarray.dev/pull/772)
207247

208-
### PyData Sphinx Theme
248+
#### Jekyll
209249

210-
This work is in progress - follow [pydata/pydata-sphinx-theme#507](https://github.com/pydata/pydata-sphinx-theme/issues/507) for details.
250+
- [Zarr](https://github.com/zarr-developers/zarr-developers.github.io/pull/144)
211251

212-
## Known limitations
252+
#### Static sites
253+
254+
On this project the content is stored in `build/en`
255+
256+
- [Networkx](https://github.com/networkx/website)
257+
258+
### Setting up a language switcher
259+
260+
Once again this will depend on the framework you are using as many of these may provide solutions
261+
for this. You can look at examples from the project described in the previous section.
213262

214263
### Missing translations
215264

216265
Translations may not always be up to date for items such as news items and
217266
release announcements. In this case, your project can decide what to do with
218267
these items (for example, keep them in English or hide them from the deployed
219268
site.)
269+
270+
### 📚 Additional resources
271+
272+
- [How to Translate Content](https://scientific-python-translations.github.io/translate/)
273+
- [FAQ](https://scientific-python-translations.github.io/faq/)
274+
- [Crowdin Setup](https://crowdin.com/)
275+
- [Scientific Python Discord – `#translation`](https://scientific-python.org/community/)
276+
- [Scientific Python Hugo Theme](https://github.com/scientific-python/scientific-python-hugo-theme/)
277+
- [pydata/pydata-sphinx-theme#507](https://github.com/pydata/pydata-sphinx-theme/issues/)

0 commit comments

Comments
 (0)