2 # Makefile to build translations
4 # Languages which we translate
5 LANGUAGES
=it pl ja fr cs gl sv nl ka tr fi ca hu nb es de lt ro mn pt_BR zh_CN zh_TW hy en_GB sk sl el da
7 # directory where phpMyAdmin sources are placed
10 # Option to po4a programs
11 PO4AOPTS
=-M utf-8
-k
15
13 # Options for generating po files using po4a
14 PO4A_PO_OPTS
=--msgid-bugs-address phpmyadmin-devel@lists.sourceforge.net \
15 --copyright-holder
"the phpMyAdmin project" \
16 --package-name
"phpMyAdmin documentation" \
19 # Options for processing text files
20 PO4A_TEXT_OPTS
=-f text
-o asciidoc
22 # Options for processing html files
23 PO4A_HTML_OPTS
=-f xhtml
26 PMA_VERSION
=$(shell sed
-n
"s/.*'PMA_VERSION', '\(.*\)'.*/\1/p" $(PMA_DIR
)/libraries
/Config.class.php
)
28 all: $(addsuffix /Documentation.html.stamp
, $(addprefix output
/, ${LANGUAGES})) \
29 $(addsuffix /index.html
, $(addprefix output
/, ${LANGUAGES})) \
30 $(addsuffix /README.stamp
, $(addprefix output
/, ${LANGUAGES})) \
31 $(addsuffix /INSTALL.stamp
, $(addprefix output
/, ${LANGUAGES})) \
32 $(addsuffix /TODO.stamp
, $(addprefix output
/, ${LANGUAGES})) \
33 $(addsuffix /themes
/original
/img
/docs_menu_bg.png
, $(addprefix output
/, ${LANGUAGES})) \
34 $(addsuffix /themes
/original
/img
/logo_right.png
, $(addprefix output
/, ${LANGUAGES})) \
35 $(addsuffix /favicon.ico
, $(addprefix output
/, ${LANGUAGES})) \
36 $(addsuffix /docs.css
, $(addprefix output
/, ${LANGUAGES})) \
40 output
/%/index.html
: po
/%.po output
/%/index-template.html
42 @po4a-translate
$(PO4A_HTML_OPTS
) -m output
/$*/index-template.html
-p
$< -l
$@
${PO4AOPTS} -k
0
44 output
/%/Documentation.html.stamp
: po
/%.po addendum
/html_head.
% addendum
/html_comment.
% orig-docs
/Documentation.html addendum
/html_credits.
%
46 @po4a-translate
$(PO4A_HTML_OPTS
) -m orig-docs
/Documentation.html
-p
$< -l output
/$*/Documentation.html
${PO4AOPTS} --addendum addendum
/html_head.
$* --addendum addendum
/html_comment.
$* --addendum addendum
/html_credits.
$*
47 @if
[ -f output
/$*/Documentation.html
] ; then sed
-i
's/@@VER@@/$(PMA_VERSION)/' output
/$*/Documentation.html
; fi
50 output
/%/README.stamp
: po
/%.po orig-docs
/README
52 @po4a-translate
$(PO4A_TEXT_OPTS
) -m orig-docs
/README
-p
$< -l output
/$*/README
${PO4AOPTS}
53 @if
[ -f output
/$*/README
] ; then sed
-i
's/@@VER@@/$(PMA_VERSION)/' output
/$*/README
; fi
56 output
/%/TODO.stamp
: po
/%.po orig-docs
/TODO
58 @po4a-translate
$(PO4A_TEXT_OPTS
) -m orig-docs
/TODO
-p
$< -l output
/$*/TODO
${PO4AOPTS}
59 @if
[ -f output
/$*/TODO
] ; then sed
-i
's/@@VER@@/$(PMA_VERSION)/' output
/$*/TODO
; fi
62 output
/%/INSTALL.stamp
: po
/%.po orig-docs
/INSTALL
64 @po4a-translate
$(PO4A_TEXT_OPTS
) -m orig-docs
/INSTALL
-p
$< -l output
/$*/INSTALL
${PO4AOPTS}
65 @if
[ -f output
/$*/INSTALL
] ; then sed
-i
's/@@VER@@/$(PMA_VERSION)/' output
/$*/INSTALL
; fi
68 .PRECIOUS
: addendum
/html_head.
%
69 addendum
/html_head.
%: po
/%.po addendum
/head.html addendum
/add-html_head
71 @po4a-translate
$(PO4A_HTML_OPTS
) -m addendum
/head.html
-p
$< -l
$@
${PO4AOPTS} -k
0 --addendum addendum
/add-html_head
73 .PRECIOUS
: addendum
/html_head-translations.
%
74 addendum
/html_head-translations.
%: po
/%.po addendum
/head.html addendum
/add-html_head-translations
76 @po4a-translate
$(PO4A_HTML_OPTS
) -m addendum
/head.html
-p
$< -l
$@
${PO4AOPTS} -k
0 --addendum addendum
/add-html_head-translations
78 .PRECIOUS
: addendum
/html_comment.
%
79 addendum
/html_comment.
%: po
/%.po addendum
/comment.html addendum
/add-html_comment
81 @po4a-translate
$(PO4A_TEXT_OPTS
) -m addendum
/comment.html
-p
$< -l
$@
${PO4AOPTS} -k
0 --addendum addendum
/add-html_comment
83 .PRECIOUS
: addendum
/html_credits.
%
84 addendum
/html_credits.
%: po
/%.po addendum
/credits.html addendum
/add-html_credits
86 @po4a-translate
$(PO4A_HTML_OPTS
) -m addendum
/credits.html
-p
$< -l
$@
${PO4AOPTS} -k
0 --addendum addendum
/add-html_credits
88 output
/%/index-template.html
: generate-lang-index get-lang-name \
89 $(wildcard $(addsuffix /Documentation.html
, output
/%) \
90 $(addsuffix /README
, output
/%) \
91 $(addsuffix /INSTALL
, output
/%) \
92 $(addsuffix /TODO
, output
/%))
93 @.
/generate-lang-index
$* > $@
95 output
/%/docs.css
: $(PMA_DIR
)/docs.css
98 output
/%/favicon.ico
: $(PMA_DIR
)/favicon.ico
101 output
/%/themes
/original
/img
/docs_menu_bg.png
: $(PMA_DIR
)/themes
/original
/img
/docs_menu_bg.png
104 output
/%/themes
/original
/img
/logo_right.png
: $(PMA_DIR
)/themes
/original
/img
/logo_right.png
107 .PRECIOUS
: output
/%/index-full-template.html
108 output
/%/index-full-template.html
: generate-lang-index get-lang-name
109 @.
/generate-lang-index
$* full
> $@
111 output
/index.html
: $(wildcard output
/*/index.html
) generate-index get-lang-name
112 @.
/generate-index
> $@
114 .PRECIOUS
: orig-docs
/%
115 orig-docs
/%: $(PMA_DIR
)/%
117 @sed
's/$(PMA_VERSION)/@@VER@@/' < $< > $@
119 .PRECIOUS
: pot
/%-html.pot
120 pot
/%-html.pot
: orig-docs
/Documentation.html output
/%/index-full-template.html addendum
/head.html addendum
/credits.html
122 @po4a-gettextize
$(PO4A_HTML_OPTS
) ${PO4A_PO_OPTS} \
123 -m orig-docs
/Documentation.html \
124 -m output
/$*/index-full-template.html \
125 -m addendum
/head.html \
126 -m addendum
/credits.html \
129 .PRECIOUS
: pot
/%-txt.pot
130 pot
/%-txt.pot
: orig-docs
/INSTALL orig-docs
/TODO orig-docs
/README addendum
/comment.html
132 @po4a-gettextize
$(PO4A_TEXT_OPTS
) ${PO4A_PO_OPTS} \
133 -m addendum
/comment.html \
134 -m orig-docs
/INSTALL \
136 -m orig-docs
/README \
139 .PRECIOUS
: pot
/%-full.pot
140 pot
/%-full.pot
: pot
/%-html.pot pot
/%-txt.pot
144 po
/%.po
: pot
/%-full.pot
146 if
[ ! -f
$@
] ; then msginit
-i
$< -l
$* --no-translator
-o
$@
; fi
149 if
[ -f
$(PMA_DIR
)/po
/$*.po
] ; then \
150 msgmerge
-U
$@
-C
$(PMA_DIR
)/po
/$*.po
$< ; \
152 msgmerge
-U
$@
$< ; \