-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (46 loc) · 2.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pwd=`pwd`
POFILES=${pwd}/fontypythonmodules/pofiles
LOCALE=${pwd}/fontypythonmodules/locale
VERS=$(shell python2 -c "import fontypythonmodules.fpversion as fpv; print fpv.version")
CH="Copyright (C) 2006,2007,2008,$(shell date +%Y) Donn.C.Ingle"
fpref=${POFILES}/fp_ref.pot
fr_FR=fr_FR.UTF-8.po
de_DE=de_DE.UTF-8.po
it_IT=it_IT.UTF-8.po
refpot :
# Making the ref.pot file. Fresh from the source.
# NOTE: The package-name and version do not make it to the final .po files
# Search me.
# I include this here because it took forever to work it out.
xgettext --package-name="fontypython" \
--package-version="${VERS}" \
--copyright-holder=${CH} \
--msgid-bugs-address="donn.ingle@gmail.com" \
-p ${POFILES} -o fp_ref.pot -L Python fontypython fontypythonmodules/*.py
# Now run make update
notused :
# This was fail. I tried to get the header info to be sensible. Can't be done.
# Merging the original template with this new export. fp_ref.pot will then be
# the latest fresh template for merging with the previous translation po files.
# (fp_orig_ref.pot must remain unchanged.)
msgmerge ${POFILES}/fp_orig_ref.pot ${fpref} -o ${fpref}
update :
# Merge the translation files (.po) with the latest .pot made from the source code.
# If people send me .po files, I should check they are named properly and then
# run this update recipe.
# Making copies of the trans files; in case...
cp ${POFILES}/${fr_FR} ${POFILES}/bak
cp ${POFILES}/${it_IT} ${POFILES}/bak
cp ${POFILES}/${de_DE} ${POFILES}/bak
# Merging the current translation files that exist ("def.po", per the gnu manual)
# with the fp_ref.pot file. Output OVER the same def.po files.
msgmerge ${POFILES}/${fr_FR} ${fpref} -o ${POFILES}/${fr_FR}
msgmerge ${POFILES}/${it_IT} ${fpref} -o ${POFILES}/${it_IT}
msgmerge ${POFILES}/${de_DE} ${fpref} -o ${POFILES}/${de_DE}
# Now translate/edit the PO files. When ready, run make mos
mos :
# Converting the PO files to MO files.
msgfmt ${POFILES}/${fr_FR} -o ${LOCALE}/fr/LC_MESSAGES/all.mo
msgfmt ${POFILES}/${it_IT} -o ${LOCALE}/it/LC_MESSAGES/all.mo
msgfmt ${POFILES}/${de_DE} -o ${LOCALE}/de/LC_MESSAGES/all.mo
# mo files have been moved.