ml: more typos.
[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 # IMPORTANT
15 # 1. Make sure your esd-LANG.po is encoded in unix format (end
16 # of line \n, not DOS \n\r), otherwise po4a-translate complains
17 # about strange lines.
18 # 2. Before generating a page for publication, make sure the PO has no
19 # untranslated or fuzzy strings, otherwise the translation will be
20 # interspersed with English strings.
21
22
23 # In LANG add the code(s) of the language(s) you intend to translate
24 LANG=es
25
26 # flags for the po4a-getextize
27 PO4A_FLAGS=-M utf-8 -f xhtml --keep 30 -o porefs=none \
28 -o 'untranslated=<script>' \
29 -o 'attributes=<meta>content'
30
31 # list of source files for the translation
32 SRC=confirmation.html\
33 index.html\
34 infographic.html\
35 mac.html\
36 next_steps.html\
37 windows.html\
38 workshops.html
39
40 # default target
41 all: $(foreach l,$(LANG),$(foreach f,$(SRC),$l/$f))
42
43
44 ## RECIPES for the individual pages in each language
45
46 # Add yours if you migrate to PO, keeping the alphabetical order.
47
48 # NOTES
49 # 1. You can use another recipe as a model, but be careful with global image
50 # localization; make sure that _all_ the images are in the static/LANG/img
51 # subdirectory.
52 # 2. The following modifications are essential in right to left languages:
53 # sed -i 's|<html|<html dir="rtl"|' $@
54 # sed -i '/\/css\/main.css/a\
55 # <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.rtl.css" />' $@
56 # See Persian recipe as an example.
57
58 # cs - Czech
59 # sed -i 's|<li><a href="/en">English - v4.0</a></li>|<li><a class="current" href="/cs">Čeština - v4.0</a></li>\
60 # <li><a href="/en">English - v4.0</a></li>|' $@
61 cs/%.html: esd-cs.po $(foreach f,$(SRC),en/$f)
62 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
63 sed -i 's|img/en/|img/cs/|g' $@
64
65 # es - Spanish
66 es/%.html: esd-es.po $(foreach f,$(SRC),en/$f)
67 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
68 sed -i '/\/css\/main.css/a\
69 <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.es.css" />' $@
70
71 # fa - Persian
72 fa/%.html: esd-fa.po $(foreach f,$(SRC),en/$f)
73 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
74 sed -i 's|<html|<html dir="rtl"|' $@
75 sed -i '/\/css\/main.css/a\
76 <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.rtl.css" />' $@
77
78 # ja - Japanese
79 ja/%.html: esd-ja.po $(foreach f,$(SRC),en/$f)
80 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
81
82 # sq - Albanian
83 sq/%.html: esd-sq.po $(foreach f,$(SRC),en/$f)
84 -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
85
86 # zh-han - Chinese (Han)
87 zh-hans/%.html: esd-zh-hans.po $(foreach f,$(SRC),en/$f)
88 -po4a-translate $(PO4A_FLAGS) --keep 0 -m en/$*.html -p $< -l $@
89