Skip to content

Commit 1134d87

Browse files
committed
move translation documentation out of README
1 parent add37b0 commit 1134d87

File tree

2 files changed

+106
-97
lines changed

2 files changed

+106
-97
lines changed

README.md

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -336,103 +336,7 @@ Documentation:
336336
337337
## Translation
338338
339-
To upload/download translation files to/from Transifex, you'll need an account
340-
there with access to these translations. Then follow the [Authentication -
341-
Transifex API v3][transauth]: to get an API token, and set
342-
`TRANSIFEX["API_TOKEN"]` in your environment with its value.
343-
344-
The [creativecommons/cc-legal-tools-data][repodata] repository must be cloned
345-
next to this `cc-legal-tools-app` repository. (It can be elsewhere, then you
346-
need to set `DATA_REPOSITORY_DIR` to its location.) Be sure to clone using a
347-
URL that starts with `git@github...` and not `https://github...`, or you won't
348-
be able to push to it. Also see [Data Repository](#data-repository), above.
349-
350-
In production, the `check_for_translation_updates` management command should be
351-
run hourly. See [Check for Translation
352-
Updates](#check-for-translation-updates), below.
353-
354-
Also see [Publishing changes to git repo](#publishing-changes-to-git-repo),
355-
below.
356-
357-
[Babel][babel] is used for localization information.
358-
359-
Documentation:
360-
- [Babel — Babel documentation][babel]
361-
- [Translation | Django documentation | Django][djangotranslation]
362-
363-
[babel]: http://babel.pocoo.org/en/latest/index.html
364-
[repodata]:https://github.com/creativecommons/cc-legal-tools-data
365-
[transauth]: https://transifex.github.io/openapi/index.html#section/Authentication
366-
367-
368-
### How the tool translation is implemented
369-
370-
Django Translation uses two sets of Gettext Files in the
371-
[creativecommons/cc-legal-tools-data][repodata] repository (the [Data
372-
Repository](#data-repository), above). See that repository for detailed
373-
information and definitions.
374-
375-
Documentation:
376-
- [Translation | Django documentation | Django][djangotranslation]
377-
- Transifex API
378-
- [Introduction to API 3.0 | Transifex Documentation][api30intro]
379-
- [Transifex API v3][api30]
380-
- Python SDK: [transifex-python/transifex/api][apisdk]
381-
382-
[api30]: https://transifex.github.io/openapi/index.html#section/Introduction
383-
[api30intro]: https://docs.transifex.com/api-3-0/introduction-to-api-3-0
384-
[apisdk]: https://github.com/transifex/transifex-python/tree/devel/transifex/api
385-
[djangotranslation]: https://docs.djangoproject.com/en/4.2/topics/i18n/translation/
386-
[repodata]: https://github.com/creativecommons/cc-legal-tools-data
387-
388-
389-
### Check for Translation Updates
390-
391-
> :warning: **This functionality is currently disabled.**
392-
393-
The hourly run of `check_for_translation_updates` looks to see if any of the
394-
translation files in Transifex have newer last modification times than we know
395-
about. It performs the following process (which can also be done manually:
396-
397-
1. Ensure the [Data Repository](#data-repository), above, is in place
398-
2. Within the [creativecommons/cc-legal-tools-data][repodata] (the [Data
399-
Repository](#data-repository)):
400-
1. Checkout or create the appropriate branch.
401-
- For example, if a French translation file for BY 4.0 has changed, the
402-
branch name will be `cc4-fr`.
403-
2. Download the updated `.po` portable object Gettext file from Transifex
404-
3. Do the [Translation Update Process](#translation-update-process) (below)
405-
- _This is important and easy to forget,_ but without it, Django will
406-
keep using the old translations
407-
4. Commit that change and push it upstream.
408-
3. Within this `cc-legal-tools-app` repository:
409-
1. For each branch that has been updated, [Generate Static
410-
Files](#generate-static-files) (below). Use the options to update git and
411-
push the changes.
412-
413-
[repodata]:https://github.com/creativecommons/cc-legal-tools-data
414-
415-
416-
### Check for Translation Updates Dependency Documentation
417-
418-
- [GitPython Documentation — GitPython documentation][gitpythondocs]
419-
- [Requests: HTTP for Humans™ — Requests documentation][requestsdocs]
420-
421-
[gitpythondocs]: https://gitpython.readthedocs.io/en/stable/index.html
422-
[requestsdocs]: https://docs.python-requests.org/en/master/
423-
424-
425-
### Translation Update Process
426-
427-
This Django Admin command must be run any time the `.po` portable object
428-
Gettext files are created or changed.
429-
430-
1. Ensure the [Data Repository](#data-repository), above, is in place
431-
2. Ensure [Docker Compose Setup](#docker-compose-setup), above, is complete
432-
3. Compile translation messages (update the `.mo` machine object Gettext files)
433-
```shell
434-
docker compose exec app ./manage.py compilemessages
435-
```
339+
See [`docs/translation.md`](docs/translation.md)
436340
437341
438342
## Generate Static Files

docs/translation.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Translation
2+
3+
(Return to primary [`../README.md`](../README.md).)
4+
5+
6+
## Overview
7+
8+
To upload/download translation files to/from Transifex, you'll need an account
9+
there with access to these translations. Then follow the [Authentication -
10+
Transifex API v3][transauth]: to get an API token, and set
11+
`TRANSIFEX["API_TOKEN"]` in your environment with its value.
12+
13+
The [creativecommons/cc-legal-tools-data][repodata] repository must be cloned
14+
next to this `cc-legal-tools-app` repository. (It can be elsewhere, then you
15+
need to set `DATA_REPOSITORY_DIR` to its location.) Be sure to clone using a
16+
URL that starts with `git@github...` and not `https://github...`, or you won't
17+
be able to push to it. See [`../README.md`](../README.md) for details.
18+
19+
~~In production, the `check_for_translation_updates` management command should
20+
be run hourly. See [Check for Translation
21+
Updates](#check-for-translation-updates), below.~~
22+
23+
Also see [Publishing changes to git repo](#publishing-changes-to-git-repo),
24+
below.
25+
26+
[Babel][babel] is used for localization information.
27+
28+
Documentation:
29+
- [Babel — Babel documentation][babel]
30+
- [Translation | Django documentation | Django][djangotranslation]
31+
32+
[babel]: http://babel.pocoo.org/en/latest/index.html
33+
[repodata]:https://github.com/creativecommons/cc-legal-tools-data
34+
[transauth]: https://transifex.github.io/openapi/index.html#section/Authentication
35+
36+
37+
## How the tool translation is implemented
38+
39+
Django Translation uses two sets of Gettext Files in the
40+
[creativecommons/cc-legal-tools-data][repodata] repository (the [Data
41+
Repository](#data-repository), above). See that repository for detailed
42+
information and definitions.
43+
44+
Documentation:
45+
- [Translation | Django documentation | Django][djangotranslation]
46+
- Transifex API
47+
- [Introduction to API 3.0 | Transifex Documentation][api30intro]
48+
- [Transifex API v3][api30]
49+
- Python SDK: [transifex-python/transifex/api][apisdk]
50+
51+
[api30]: https://transifex.github.io/openapi/index.html#section/Introduction
52+
[api30intro]: https://docs.transifex.com/api-3-0/introduction-to-api-3-0
53+
[apisdk]: https://github.com/transifex/transifex-python/tree/devel/transifex/api
54+
[djangotranslation]: https://docs.djangoproject.com/en/4.2/topics/i18n/translation/
55+
[repodata]: https://github.com/creativecommons/cc-legal-tools-data
56+
57+
58+
## Check for translation updates
59+
60+
> :warning: **This functionality is currently disabled.**
61+
62+
~~The hourly run of `check_for_translation_updates` looks to see if any of the
63+
translation files in Transifex have newer last modification times than we know
64+
about. It performs the following process (which can also be done manually:~~
65+
66+
1. ~~Ensure the Data Repository ([`../README.md`](../README.md)) is in place~~
67+
2. ~~Within the [creativecommons/cc-legal-tools-data][repodata] (the [Data
68+
Repository](#data-repository)):~~
69+
1. ~~Checkout or create the appropriate branch.~~
70+
- ~~For example, if a French translation file for BY 4.0 has changed, the
71+
branch name will be `cc4-fr`.~~
72+
2. ~~Download the updated `.po` portable object Gettext file from
73+
Transifex~~
74+
3. ~~Do the [Translation Update Process](#translation-update-process)
75+
(below)~~
76+
- ~~_This is important and easy to forget,_ but without it, Django will
77+
keep using the old translations~~
78+
4. ~~Commit that change and push it upstream.~~
79+
3.~~ Within this `cc-legal-tools-app` repository:~~
80+
1. ~~For each branch that has been updated, Generate Static
81+
Files ([`../README.md`](../README.md)). Use the options to update git and
82+
push the changes.~~
83+
84+
[repodata]:https://github.com/creativecommons/cc-legal-tools-data
85+
86+
87+
Documentation:
88+
- [GitPython Documentation — GitPython documentation][gitpythondocs]
89+
- [Requests: HTTP for Humans™ — Requests documentation][requestsdocs]
90+
91+
[gitpythondocs]: https://gitpython.readthedocs.io/en/stable/index.html
92+
[requestsdocs]: https://docs.python-requests.org/en/master/
93+
94+
95+
## Translation Update Process
96+
97+
This Django Admin command must be run any time the `.po` portable object
98+
Gettext files are created or changed.
99+
100+
1. Ensure the [Data Repository](#data-repository), above, is in place
101+
2. Ensure [Docker Compose Setup](#docker-compose-setup), above, is complete
102+
3. Compile translation messages (update the `.mo` machine object Gettext files)
103+
```shell
104+
docker compose exec app ./manage.py compilemessages
105+
```

0 commit comments

Comments
 (0)