en: add the Persian language.
[enc.git] / Makefile.gen
1 # This source code is released in public domain.
2
3 # Author Tomas Stary (2016) <tomichec@gmail.com>
4 # Thanks for helpfull discussion to Thérèse Godefroy
5
6 # this Makefile.gen is used to generate the translated html files from the
7 # PO templates
8
9 # see Makefile for generation of translation files (po, pot) and
10 # extraction of translated strings from existing translation
11
12 # usage: make -f Makefile.gen
13
14 # flags for the po4a-getextize
15 PO4A_FLAGS=-M utf-8 -f xhtml --keep 30 -o porefs=none \
16 -o 'untranslated=<script>' \
17 -o 'attributes=<meta>content'
18 # list of source files for the translation
19 SRC=confirmation.html\
20 index.html\
21 infographic.html\
22 mac.html\
23 next_steps.html\
24 windows.html\
25 workshops.html
26
27 # list of languages that use the PO files (add yours if you migrate to PO)
28 # czech - cs, persian - fa
29 # in the LANG add the code(s) of the language(s) you intend to translate
30 LANG=fa
31
32 # NOTE:
33 # The following replacement is essential in right to left languages
34 # sed -i 's|<html>|<html dir="rtl">|' $@
35 # See Persian recipe as an example
36
37 # default target
38 all: $(foreach l,$(LANG),$(foreach f,$(SRC),$l/$f))
39
40
41 # IMPORTANT: make sure your esd-lang.po is encoded in unix format (end
42 # of line \n, not DOS \n\r), otherwise the po4a-translate complains
43 # about strange lines.
44
45
46 # recipes for the individual pages in each language
47 # Czech
48 # sed -i 's|<li><a href="/en">English - v4.0</a></li>|<li><a class="current" href="/cs">Čeština - v4.0</a></li>\
49 # <li><a href="/en">English - v4.0</a></li>|' $@
50 cs/%.html: esd-cs.po $(foreach f,$(SRC),en/$f)
51 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
52 sed -i 's|<li><a class="current" href="/en">English - v4.0</a></li>|<li><a href="/en">English - v4.0</a></li>|' $@
53 sed -i 's|img/en/|img/cs/|g' $@
54
55 # Persian
56 fa/%.html: esd-fa.po $(foreach f,$(SRC),en/$f)
57 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
58 sed -i 's|<html>|<html dir="rtl">|' $@
59 sed -i 's|<li><a class="current" href="/en">English - v4.0</a></li>|<li><a href="/en">English - v4.0</a></li>|' $@
60
61 # (copy the recipe for your language if you migrate to PO)
62