Mercurial > p > roundup > code
annotate locale/GNUmakefile @ 7399:deb8e7e6d66d
Skip redis tests if unable to communicate with the server.
If the redis module is in the test environment, the redis tests will
not be skipped. If connecting to redis during testing fails with a
ConnectionError because there is no redis server at localhost, or if
it fails with an AuthenticationError, you would fail a slew of tests.
This causes the tests to report as skipped if either of the two errors
occurs. It is very inefficient as it fails in setup() for the tests,
but at least it does report skipping the tests.
Also documented how to pass the redis password to the tests in the
test part of the install docs. Future note: running tests needs proper
docs in development.txt (including database setup) and a link left to
that doc in installation.txt.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 24 May 2023 12:52:53 -0400 |
| parents | b222658a3504 |
| children |
| rev | line source |
|---|---|
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
1 # Extract translatable strings from Roundup sources, |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
2 # update and compile all existing translations |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
3 |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
4 # tool locations |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
5 XPOT ?= xpot |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
6 MSGFMT ?= msgfmt |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
7 MSGMERGE ?= msgmerge |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
8 XGETTEXT ?= xgettext |
|
6609
b6452b669720
Updates, python3, hg diff, add target doc, add pytest target
John Rouillard <rouilj@ieee.org>
parents:
6483
diff
changeset
|
9 PYTHON ?= python3 |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
10 |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
11 TEMPLATE=roundup.pot |
|
2306
1421b19cd61b
build message template file
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
diff
changeset
|
12 |
|
4094
5a9631828e33
update message template file building:
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3761
diff
changeset
|
13 PACKAGES=$(shell find ../roundup ../share/roundup/templates -name '*.py' \ |
|
3761
800bc51a9c8e
add template directories to the list of Python packages for message extraction
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3593
diff
changeset
|
14 | sed -e 's,/[^/]*$$,,' | sort | uniq) |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
15 SOURCES=$(PACKAGES:=/*.py) |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
16 PO_FILES=$(wildcard *.po) |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
17 MO_FILES=$(PO_FILES:.po=.mo) |
|
6222
2c0f7f16ce04
Check that build link is present otherwise abort.
John Rouillard <rouilj@ieee.org>
parents:
4570
diff
changeset
|
18 PYTHON_BUILD=../build/lib |
|
2c0f7f16ce04
Check that build link is present otherwise abort.
John Rouillard <rouilj@ieee.org>
parents:
4570
diff
changeset
|
19 RUN_PYTHON=PYTHONPATH=$(PYTHON_BUILD) $(PYTHON) -O |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
20 |
|
2455
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
21 all: dist |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
22 |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
23 help: |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
24 @echo "$(MAKE) - build MO files. Run this before sdist" |
|
6618
ebd8f962fbf1
Fix make help. Missing close quotes.
John Rouillard <rouilj@ieee.org>
parents:
6609
diff
changeset
|
25 @echo "$(MAKE) dist - same as above" |
|
2455
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
26 @echo "$(MAKE) template - update message template from sources" |
|
6609
b6452b669720
Updates, python3, hg diff, add target doc, add pytest target
John Rouillard <rouilj@ieee.org>
parents:
6483
diff
changeset
|
27 @echo "$(MAKE) diff - see template differences in vi" |
| 7052 | 28 @echo "$(MAKE) potest - check .po files for errors" |
|
6618
ebd8f962fbf1
Fix make help. Missing close quotes.
John Rouillard <rouilj@ieee.org>
parents:
6609
diff
changeset
|
29 @echo "$(MAKE) pytest - create locale files to run pytest" |
|
2455
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
30 @echo "$(MAKE) locale.po - update message file from template" |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
31 @echo "$(MAKE) locale.mo - compile individual message file" |
|
6618
ebd8f962fbf1
Fix make help. Missing close quotes.
John Rouillard <rouilj@ieee.org>
parents:
6609
diff
changeset
|
32 @echo "$(MAKE) help - this text" |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
33 |
|
2455
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
34 # This will rebuild all MO files without updating their corresponding PO |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
35 # files first. Run before creating Roundup distribution (hence the name). |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
36 # PO files should be updated by their translators only, automatic update |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
37 # adds unwanted fuzzy labels. |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
38 dist: |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
39 for file in $(PO_FILES); do \ |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
40 ${MSGFMT} -o `basename $$file .po`.mo $$file; \ |
|
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
41 done |
|
2306
1421b19cd61b
build message template file
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
diff
changeset
|
42 |
|
2455
ece6ed48dd3d
by default, build binary message catalogs only...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2384
diff
changeset
|
43 template: |
|
6609
b6452b669720
Updates, python3, hg diff, add target doc, add pytest target
John Rouillard <rouilj@ieee.org>
parents:
6483
diff
changeset
|
44 test -d $(PYTHON_BUILD) || (echo "Missing build directory $(PYTHON_BUILD). ln -s lib to build library"; exit 1) |
|
2459
fd04f41ab988
fix: 'template' target was meant to make 'roundup.pot' file
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2455
diff
changeset
|
45 ${XPOT} -n -o $(TEMPLATE) $(SOURCES) |
|
6222
2c0f7f16ce04
Check that build link is present otherwise abort.
John Rouillard <rouilj@ieee.org>
parents:
4570
diff
changeset
|
46 |
|
2459
fd04f41ab988
fix: 'template' target was meant to make 'roundup.pot' file
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2455
diff
changeset
|
47 ${RUN_PYTHON} ../roundup/cgi/TAL/talgettext.py -u $(TEMPLATE) \ |
|
4094
5a9631828e33
update message template file building:
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3761
diff
changeset
|
48 ../share/roundup/templates/classic/html/*.html \ |
|
6405
a21b574554c3
extract translatable strings from devel and responsive templates
John Rouillard <rouilj@ieee.org>
parents:
6222
diff
changeset
|
49 ../share/roundup/templates/devel/html/*.html \ |
|
a21b574554c3
extract translatable strings from devel and responsive templates
John Rouillard <rouilj@ieee.org>
parents:
6222
diff
changeset
|
50 ../share/roundup/templates/minimal/html/*.html \ |
|
a21b574554c3
extract translatable strings from devel and responsive templates
John Rouillard <rouilj@ieee.org>
parents:
6222
diff
changeset
|
51 ../share/roundup/templates/responsive/html/*.html |
|
6672
01216187a167
Testing translations in mailgw.py, update translations, i18n improved
John Rouillard <rouilj@ieee.org>
parents:
6618
diff
changeset
|
52 VERSION="`sed -ne \"/__version__/s/.*'\(.*\)'.*/\1/p\" \ |
|
01216187a167
Testing translations in mailgw.py, update translations, i18n improved
John Rouillard <rouilj@ieee.org>
parents:
6618
diff
changeset
|
53 ../build/lib/roundup/__init__.py`"; \ |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
54 ${XGETTEXT} -j -w 80 -F \ |
|
6672
01216187a167
Testing translations in mailgw.py, update translations, i18n improved
John Rouillard <rouilj@ieee.org>
parents:
6618
diff
changeset
|
55 --package-name=Roundup \ |
|
01216187a167
Testing translations in mailgw.py, update translations, i18n improved
John Rouillard <rouilj@ieee.org>
parents:
6618
diff
changeset
|
56 --package-version=$$VERSION \ |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
57 --msgid-bugs-address=roundup-devel@lists.sourceforge.net \ |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
58 --copyright-holder="See Roundup README.txt" \ |
|
2459
fd04f41ab988
fix: 'template' target was meant to make 'roundup.pot' file
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2455
diff
changeset
|
59 -o $(TEMPLATE) $(SOURCES) |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
60 |
|
6609
b6452b669720
Updates, python3, hg diff, add target doc, add pytest target
John Rouillard <rouilj@ieee.org>
parents:
6483
diff
changeset
|
61 pytest local_install: dist |
| 6480 | 62 for file in $(MO_FILES); do \ |
|
6483
9730eff21de3
Remove verbose from local_install. Cleanup log.
John Rouillard <rouilj@ieee.org>
parents:
6480
diff
changeset
|
63 lang=`basename $$file .mo`; \ |
| 6480 | 64 mkdir -p locale/$$lang/LC_MESSAGES; \ |
| 65 cp $$file locale/$$lang/LC_MESSAGES/roundup.mo; \ | |
| 66 done | |
| 67 | |
|
3578
782287e01b99
added template diff target: view changes in message strings
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2459
diff
changeset
|
68 # helps to check template file before check in |
|
782287e01b99
added template diff target: view changes in message strings
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2459
diff
changeset
|
69 diff: |
| 7052 | 70 hg cat roundup.pot | diff -u -I '^\#: \.\./roundup.*$$' \ |
| 71 -I '^#:\s*:[0-9]*.*$$' \ | |
| 72 - roundup.pot || exit 0 | |
| 73 potest: | |
|
7202
b222658a3504
Sort potest by number of translated messages.
John Rouillard <rouilj@ieee.org>
parents:
7052
diff
changeset
|
74 sh -c 'for file in $(PO_FILES); do \ |
|
b222658a3504
Sort potest by number of translated messages.
John Rouillard <rouilj@ieee.org>
parents:
7052
diff
changeset
|
75 ${MSGFMT} -cv --statistics $$file; \ |
|
b222658a3504
Sort potest by number of translated messages.
John Rouillard <rouilj@ieee.org>
parents:
7052
diff
changeset
|
76 done' 2>&1 | sort -k 2,2n |
|
3578
782287e01b99
added template diff target: view changes in message strings
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2459
diff
changeset
|
77 |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
78 %.po: $(TEMPLATE) |
|
3593
3d9e1906ba58
don't wrap po files at position 72
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
3578
diff
changeset
|
79 ${MSGMERGE} -U --suffix=.bak $@ $< |
|
2330
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
80 |
|
8ae58eda9331
in addition to xpot...
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2306
diff
changeset
|
81 %.mo: %.po |
|
2342
106737dbe689
show statistics for message catalogs
Alexander Smishlajev <a1s@users.sourceforge.net>
parents:
2330
diff
changeset
|
82 ${MSGFMT} --statistics -o $@ $< |
|
6672
01216187a167
Testing translations in mailgw.py, update translations, i18n improved
John Rouillard <rouilj@ieee.org>
parents:
6618
diff
changeset
|
83 |
|
01216187a167
Testing translations in mailgw.py, update translations, i18n improved
John Rouillard <rouilj@ieee.org>
parents:
6618
diff
changeset
|
84 roundup.pot: template |
