ua: Initial commit. Copied ua/ from en/. A few changes to the esd-ua.po. Getting...
[enc.git] / Makefile.gen
index f5f9618f55202352c08c48c47f5d2ff5a61708f1..be8dc4ba5a9bfad56d5e27a247c4d8a253969b15 100644 (file)
@@ -1,6 +1,6 @@
 # This source code is released in public domain.
 
-# Author Tomas Stary (2016) <tomichec@gmail.com> 
+# Author Tomas Stary (2016) <tomichec@gmail.com>
 # Thanks for helpfull discussion to Thérèse Godefroy
 
 # this Makefile.gen is used to generate the translated html files from the
@@ -21,7 +21,7 @@
 
 
 # In LANG add the code(s) of the language(s) you intend to translate
-LANG=es
+LANG=de
 
 # flags for the po4a-getextize
 PO4A_FLAGS=-M utf-8 -f xhtml --keep 30 -o porefs=none \
@@ -41,15 +41,21 @@ SRC=confirmation.html\
 all: $(foreach l,$(LANG),$(foreach f,$(SRC),$l/$f))
 
 
+## Function to select gsed if sed is not GNU sed but BSD sed
+define sedi
+    sed --version >/dev/null 2>&1 && sed -i || gsed -i
+endef
+
+
 ## RECIPES for the individual pages in each language
 
 # Add yours if you migrate to PO, keeping the alphabetical order.
 
 # NOTES
 # 1. You can use another recipe as a model, but be careful with global image
-#    localization; make sure that _all_ the images are in the static/LANG/img
+#    localization; make sure that _all_ images are in the static/LANG/img
 #    subdirectory.
-# 2. The following modifications are essential in right to left languages:
+# 2. The following modifications are essential for right to left languages:
 #      sed -i 's|<html|<html dir="rtl"|' $@
 #      sed -i '/\/css\/main.css/a\
 #      <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.rtl.css" />' $@
@@ -67,6 +73,15 @@ es/%.html: esd-es.po $(foreach f,$(SRC),en/$f)
        -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
        sed -i '/\/css\/main.css/a\
        <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.es.css" />' $@
+       sed -i 's,static.fsf.org/nosvn/enc-dev0/img/en,static.fsf.org/nosvn/enc-dev0/img/es,g' $@
+       sed -i 's,emailselfdefense.fsf.org/en/infographic.html,emailselfdefense.fsf.org/es/infographic.html,' $@
+
+# de - German
+de/%.html: esd-de.po $(foreach f,$(SRC),en/$f)
+       -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
+       $(sedi) '{s|img/en/|img/de/|g;}' $@
+       $(sedi) '/\/css\/main.css/a\
+       <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.de.css" />' $@
 
 # fa - Persian
 fa/%.html: esd-fa.po $(foreach f,$(SRC),en/$f)
@@ -79,6 +94,12 @@ fa/%.html: esd-fa.po $(foreach f,$(SRC),en/$f)
 ja/%.html: esd-ja.po $(foreach f,$(SRC),en/$f)
        -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
 
+# pt-br - Brazilian Portuguese
+pt-br/%.html: esd-pt-br.po $(foreach f,$(SRC),en/$f)
+       -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
+       sed -i '/\/donate.png" \/><\/a><\/p>/a\
+       \n<div class="fsf-emphasis"><p>Conheça também a <a\nhref="http://www.fsfla.org/ikiwiki/index.pt.html">FSFLA</a>, organização\nirmã da FSF na América Latina.</p></div>' $@
+
 # sq - Albanian
 sq/%.html: esd-sq.po $(foreach f,$(SRC),en/$f)
        -po4a-translate $(PO4A_FLAGS) -m en/$*.html -p $< -l $@
@@ -86,4 +107,15 @@ sq/%.html: esd-sq.po $(foreach f,$(SRC),en/$f)
 # zh-han - Chinese (Han)
 zh-hans/%.html: esd-zh-hans.po $(foreach f,$(SRC),en/$f)
        -po4a-translate $(PO4A_FLAGS) --keep 0 -m en/$*.html -p $< -l $@
+       sed -i 's|img/en/|img/zh-hans/|g' $@
+       sed -i '/\/css\/main.css/a\
+       <link rel="stylesheet" href="//static.fsf.org/nosvn/enc-dev0/css/main.zh-hans.css" />' $@
+
+# tr - Turkish
+tr/%.html: esd-tr.po $(foreach f,$(SRC),en/$f)
+       -po4a-translate $(PO4A_FLAGS) --keep 0 -m en/$*.html -p $< -l $@
+       sed -i 's|img/en/|img/tr/|g' $@
+       sed -i 's|img/tr/screenshots/workshop-section1|img/en/screenshots/workshop-section1|' $@
+       sed -i '/alt="Bağış"/ i\
+       style="width:160px"' $@