@@ -336,103 +336,7 @@ Documentation:
336
336
337
337
## Translation
338
338
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)
436
340
437
341
438
342
## Generate Static Files
0 commit comments