Skip to content

Commit

Permalink
docs/translations: point to a+ for transifex workflow, remove unused …
Browse files Browse the repository at this point in the history
…make command
  • Loading branch information
fuzzylogic2000 committed Mar 2, 2023
1 parent 5af6de8 commit dc372cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 70 deletions.
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,6 @@ po:
mo:
$(VIRTUAL_ENV)/bin/python manage.py compilemessages

.PHONY: tx-mo
tx-mo:
$(VIRTUAL_ENV)/bin/tx pull -a
$(VIRTUAL_ENV)/bin/python manage.py compilemessages

.PHONY: release
release: export DJANGO_SETTINGS_MODULE ?= euth_wagtail.settings.build
release:
Expand Down
67 changes: 2 additions & 65 deletions docs/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,10 @@
### Install the transifex client if you haven't already
- see https://github.com/transifex/cli for instructions

### Extracting strings from source code
### Adding new strings to translate and get new translations from transifex

- required if msg_ids were added or changed
- pull translated strings from transifex
Please follow the [docs from a+](https://github.com/liqd/adhocracy-plus/blob/main/docs/languages_and_translations.md).

tx pull -a

- run make messages for python/html (domain django)
and javascript (domain djangojs)

python manage.py makemessages -d djangojs
python manage.py makemessages -d django

- replace absolute paths for a4 strings with relatives

sed -i 's%#: .*/adhocracy4%#: adhocracy4%' locale/*/LC_MESSAGES/django*.po

- for en_GB sync msg_ids with msg_strs

msgen locale/en_GB/LC_MESSAGES/django.po -o locale/en_GB/LC_MESSAGES/django.po
msgen locale/en_GB/LC_MESSAGES/djangojs.po -o locale/en_GB/LC_MESSAGES/djangojs.po

- after chaining msg_ids, check if translations (except en_GB) need manual merge
- commit changes
- always push en_GB to transifex

tx push -s

- always push other languages (make sure not to override translated strings)

tx push -t


### Pulling new translations

- required if translators worked on transifex
- update all languages except en_GB

tx pull -a -f

- Since translations files pulled from transifex have slightly different format, run

make po

to standardise.
### Compiling local translations

- required to see translations on local server

python manage.py compilemessages

- do not commit those files
- for dev, stage and prod a build server must do this

### Shortcuts

- pulling and compiling

make tx-mo

- extracting and update for en_GB

make po

- compiling

make mo

### Adding a new language

Expand Down

0 comments on commit dc372cb

Please sign in to comment.