annotate locale/GNUmakefile @ 7052:4b6a6b794dfa

Fix errors in po files. Trying to get translation files in shape for translationproject.org. Not sure it wil happen but this checkin fixes errors in .po files found by msgfmt -cv. Recreated template and merged into .po files. Also adds potest to makefile targets and improves diff target. Fixes: Project-Id-Version changed to 2.3.0. I can't find doc on what this is supposed to be. I assume it is to match the .po file to the release since there are other fields for recording the last update to the translations. Language header, is often blank. Added Language-Team value where missing. Plural-Forms header for a couple of languages per: https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html Japanese still has an issue. There are plural forms defined in the file, but according to the above, there should only be one form. I don't know Japanese, so am not qualified to remove the plural forms or change the Plural-Forms header to the expected: nplurals=1; plural=0; So I have left it with: nplurals=2; plural=0;\n" Which will always choose the first plural form (index 0). Added Last-Translator, Language and Content-Transfer-Encoding for en.po.
author John Rouillard <rouilj@ieee.org>
date Sun, 20 Nov 2022 11:29:31 -0500
parents 01216187a167
children b222658a3504
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
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
0f0cee081990 Force test of a locale
John Rouillard <rouilj@ieee.org>
parents: 6405
diff changeset
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
0f0cee081990 Force test of a locale
John Rouillard <rouilj@ieee.org>
parents: 6405
diff changeset
64 mkdir -p locale/$$lang/LC_MESSAGES; \
0f0cee081990 Force test of a locale
John Rouillard <rouilj@ieee.org>
parents: 6405
diff changeset
65 cp $$file locale/$$lang/LC_MESSAGES/roundup.mo; \
0f0cee081990 Force test of a locale
John Rouillard <rouilj@ieee.org>
parents: 6405
diff changeset
66 done
0f0cee081990 Force test of a locale
John Rouillard <rouilj@ieee.org>
parents: 6405
diff changeset
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
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
70 hg cat roundup.pot | diff -u -I '^\#: \.\./roundup.*$$' \
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
71 -I '^#:\s*:[0-9]*.*$$' \
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
72 - roundup.pot || exit 0
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
73 potest:
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
74 for file in $(PO_FILES); do \
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
75 ${MSGFMT} -cv $$file; \
4b6a6b794dfa Fix errors in po files.
John Rouillard <rouilj@ieee.org>
parents: 6672
diff changeset
76 done
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

Roundup Issue Tracker: http://roundup-tracker.org/