c1036a3236a97e4773fb731c4259c22d293666ce
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

1) # Directions for adding a new language:
2) # 1. Add the two-letter code to LANGS below.
3) # 2. Add a new "%.html.es: es/%.wml en/%.wml" clause below.
4) # 3. Add a new ".deps/%.html.es.d: es/%.wml .deps/.stamp" clause below.
5) # 4. mkdir a new two-letter directory. Make sure there's a foot.wmi
6) #    and navigation.wmi.
7) # 5. Edit include/perl-globals.wmi, add to @LANGUAGES and %LANGUAGES.
8) #    You might find useful %LANGUAGES strings at the bottom of
9) #    http://debian.org/
10) # 6. Add a new images/es.png flag image.
11) 
12) WMLOPT  = \
13)           -I $(WMLBASE)/include \
14)           -D DOCROOT=$(WMLBASE) \
15)           -D IMGROOT=$(WMLBASE)/images \
16)           -D TORGIT=$(TORGIT)\
17)           -D DEVTAG=$(DEVTAG) \
18)           -D STABLETAG=$(STABLETAG)
19) 
Roger Dingledine now the french translation...

Roger Dingledine authored 13 years ago

20) #LANGS=ar bms de en es et fa it fi fr ja ko nl no pl pt ru se tr zh-cn
Runa A. Sandvik include languages fa and de

Runa A. Sandvik authored 13 years ago

21) LANGS=en ar es fr ru pl da it fa de
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

22) 
23) WMLFILES=$(wildcard $(patsubst %, %/*.wml, $(LANGS)))
24) WMIFILES=$(wildcard $(patsubst %, %/*.wmi, $(LANGS)) $(WMLBASE)/include/*.wmi )
25) 
Andrew Lewman fix up variables and spaces.

Andrew Lewman authored 14 years ago

26) HTMLFILES=$(shell perl -le 's,  (.*)/(.*).wml  ,        $$2.html.$$1    ,x, print $$_ for @ARGV' $(WMLFILES))
27) DEPFILES=$(shell perl -le 's,  (.*)/(.*).wml  ,  .deps/$$2.html.$$1.d  ,x, print $$_ for @ARGV' $(WMLFILES))
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

28) 
29) 
30) all: $(HTMLFILES)
31) 
32) %.html.en: en/%.wml
33) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
34) 
35) %.html.ar: ar/%.wml en/%.wml
36) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
37) 
38) %.html.bms: bms/%.wml en/%.wml
39) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
40) 
41) %.html.es: es/%.wml en/%.wml
42) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
43) 
44) %.html.et: et/%.wml en/%.wml
45) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
46) 
47) %.html.de: de/%.wml en/%.wml
48) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
49) 
Runa A. Sandvik include more languages

Runa A. Sandvik authored 13 years ago

50) %.html.da: da/%.wml en/%.wml
51) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
52) 
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

53) %.html.fa: fa/%.wml en/%.wml
54) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
55) 
56) %.html.it: it/%.wml en/%.wml
57) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
58) 
59) %.html.fi: fi/%.wml en/%.wml
60) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
61) 
62) %.html.fr: fr/%.wml en/%.wml
63) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
64) 
65) %.html.ja: ja/%.wml en/%.wml
66) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
67) 
68) %.html.ko: ko/%.wml en/%.wml
69) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
70) 
71) %.html.nl: nl/%.wml en/%.wml
72) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
73) 
74) %.html.no: no/%.wml en/%.wml
75) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
76) 
77) %.html.pl: pl/%.wml en/%.wml
78) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
79) 
80) %.html.pt: pt/%.wml en/%.wml
81) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
82) 
83) %.html.ru: ru/%.wml en/%.wml
84) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
85) 
86) %.html.se: se/%.wml en/%.wml
87) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
88) 
89) %.html.tr: tr/%.wml en/%.wml
90) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
91) 
92) %.html.zh-cn: zh-cn/%.wml en/%.wml
93) 	lang=`dirname $<` && wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $@
94) 
95) .deps/%.html.en.d: en/%.wml .deps/.stamp
96) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
97) 	lang=`dirname $<` && \
98) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
99) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
100) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
101) 	rm -f $$tmpfile
Runa A. Sandvik minor fix

Runa A. Sandvik authored 13 years ago

102) .deps/%.html.ar.d: ar/%.wml .deps/.stamp
Andrew Lewman first cut of the new, shiny...

Andrew Lewman authored 14 years ago

103) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
104) 	lang=`dirname $<` && \
105) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
106) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
107) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
108) 	rm -f $$tmpfile
109) .deps/%.html.bms.d: bms/%.wml .deps/.stamp
110) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
111) 	lang=`dirname $<` && \
112) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
113) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
114) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
115) 	rm -f $$tmpfile
116) .deps/%.html.es.d: es/%.wml .deps/.stamp
117) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
118) 	lang=`dirname $<` && \
119) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
120) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
121) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
122) 	rm -f $$tmpfile
123) .deps/%.html.et.d: et/%.wml .deps/.stamp
124) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
125) 	lang=`dirname $<` && \
126) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
127) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
128) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
129) 	rm -f $$tmpfile
130) .deps/%.html.de.d: de/%.wml .deps/.stamp
131) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
132) 	lang=`dirname $<` && \
133) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
134) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \
Runa A. Sandvik include more languages

Runa A. Sandvik authored 13 years ago

135) 	sed -e s',\(^[^ ]*\):,.deps/\1.d:,' < $$tmpfile >> $@ && \
136) 	rm -f $$tmpfile
137) .deps/%.html.da.d: da/%.wml .deps/.stamp
138) 	tmpfile=`mktemp -t tmp.XXXXXXX` \
139) 	lang=`dirname $<` && \
140) 	OUT=`echo $@ | sed -e 's,\.deps/\(.*\)\.d$$,\1,'` && \
141) 	wml $(WMLOPT) -I $$lang -I $(WMLBASE)/$$lang -D LANG=$$lang $< -o $$OUT --depend | tee $$tmpfile > $@ && \