2 localedir = @LOCALEDIR@
12 ../fvwm/ConfigFvwmSetup \
13 ../modules/FvwmForm/FvwmForm-Setup.in
15 FVWMTASKBAR_POT_FILES = \
16 ../modules/FvwmTaskBar/Goodies.c \
17 ../modules/FvwmTaskBar/FvwmTaskBar.c
19 FVWMSCRIPT_POT_FILES = \
20 ../modules/FvwmScript/Scripts/FvwmScript-BellSetup \
21 ../modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup \
22 ../modules/FvwmScript/Scripts/FvwmScript-PointerSetup \
23 ../modules/FvwmScript/Scripts/FvwmScript-ScreenSetup \
24 ../modules/FvwmScript/Scripts/FvwmScript-FileBrowser
27 @POFILES@ @GMOFILES@ fvwm.pot FvwmTaskBar.pot FvwmScript.pot \
28 remove-potcdate.sed remove-potcdate.sin
30 COPYRIGHT_HOLDER = fvwm workers
32 # These options get passed to xgettext.
33 XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
35 # This is the list of locale categories, beyond LC_MESSAGES, for which the
36 # message catalogs shall be used. It is usually empty.
37 EXTRA_LOCALE_CATEGORIES =
39 MSGMERGE_UPDATE = @MSGMERGE@ --update
41 SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update
44 @echo "$(MSGFMT) -c -o $@ $<"; \
45 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
48 @lang=`echo $* | sed -e 's,.*/,,'`; \
49 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
50 if test -f $${lang}.po; then \
51 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
52 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo; \
56 sed -e '/^#/d' $< > t-$@
60 all-local: all-local-@USE_NLS@
62 # make [all] should do nothing ...
63 #all-local-yes: $(CATALOGS)
69 maintainer-clean-local:
72 $(FVWM_DOMAIN).pot-update: $(FVWM_POT_FILES) \
76 rcpotfiles='$(FVWMRC_POT_FILES)'; \
78 for file in $$rcpotfiles; do \
79 perl -ne 's/\[gt\.((\\.|.)+?)\]/ print \
80 "\#$$ARGV: line $$.\n"."msgid \"$$1\"\n"."msgstr \"\"\n\n"/ge' \
81 $$file >> duplicate; \
83 msguniq duplicate > fvwmrc.pot;
85 potfiles='$(FVWM_POT_FILES)'; \
87 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) -o $(FVWM_DOMAIN).po \
88 --copyright-holder='$(COPYRIGHT_HOLDER)' $$potfiles; \
89 test ! -f $(FVWM_DOMAIN).po || { \
90 if test -f $(srcdir)/$(FVWM_DOMAIN).pot; then \
91 sed -f remove-potcdate.sed < $(srcdir)/$(FVWM_DOMAIN).pot > $(FVWM_DOMAIN).1po && \
92 sed -f remove-potcdate.sed < $(FVWM_DOMAIN).po > $(FVWM_DOMAIN).2po && \
93 if cmp $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po >/dev/null 2>&1; then \
94 rm -f $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po $(FVWM_DOMAIN).po; \
96 rm -f $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po $(srcdir)/$(FVWM_DOMAIN).pot && \
97 mv $(FVWM_DOMAIN).po $(srcdir)/$(FVWM_DOMAIN).pot; \
100 mv $(FVWM_DOMAIN).po $(srcdir)/$(FVWM_DOMAIN).pot; \
102 mv $(FVWM_DOMAIN).pot duplicate.pot; \
103 cat fvwmrc.pot >> duplicate.pot; \
104 msguniq duplicate.pot > $(FVWM_DOMAIN).pot; \
105 rm -f duplicate.pot fvwmrc.pot; \
108 $(srcdir)/$(FVWM_DOMAIN).pot:
109 $(MAKE) $(FVWM_DOMAIN).pot-update
111 $(FVWMTASKBAR_DOMAIN).pot-update: $(FVWMTASKBAR_POT_FILES) \
113 potfiles='$(FVWMTASKBAR_POT_FILES)'; \
115 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
116 -o $(FVWMTASKBAR_DOMAIN).po \
117 --copyright-holder='$(COPYRIGHT_HOLDER)' $$potfiles; \
118 test ! -f $(FVWMTASKBAR_DOMAIN).po || { \
119 if test -f $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; then \
120 sed -f remove-potcdate.sed < $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot \
121 > $(FVWMTASKBAR_DOMAIN).1po && \
122 sed -f remove-potcdate.sed < $(FVWMTASKBAR_DOMAIN).po \
123 > $(FVWMTASKBAR_DOMAIN).2po && \
124 if cmp $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \
125 >/dev/null 2>&1; then \
126 rm -f $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \
127 $(FVWMTASKBAR_DOMAIN).po; \
129 rm -f $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \
130 $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot && \
131 mv $(FVWMTASKBAR_DOMAIN).po $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; \
134 mv $(FVWMTASKBAR_DOMAIN).po $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; \
138 $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot:
139 $(MAKE) $(FVWMTASKBAR_DOMAIN).pot-update
141 $(FVWMSCRIPT_DOMAIN).pot-update: $(FVWMSCRIPT_POT_FILES) \
143 potfiles='$(FVWMSCRIPT_POT_FILES)'; \
145 for file in $$potfiles; do \
146 perl -ne 's/LocaleTitle\s+\{((\\.|.)+?)\}/ print \
147 "\#$$ARGV: line $$.\n"."msgid \"$$1\"\n"."msgstr \"\"\n\n"/ge' \
148 $$file >> duplicate; \
150 msguniq duplicate > duplicate.pot; \
151 cat pot_head_sample > $(FVWMSCRIPT_DOMAIN).pot; \
152 cat duplicate.pot >> $(FVWMSCRIPT_DOMAIN).pot; \
153 rm -f duplicate duplicate.pot;
155 $(srcdir)/$(FVWMSCRIPT_DOMAIN).pot:
156 $(MAKE) $(FVWMSCRIPT_DOMAIN).pot-update
158 $(POFILES): $(srcdir)/$(FVWM_DOMAIN).pot $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot \
159 $(srcdir)/$(FVWMSCRIPT_DOMAIN).pot
160 dlang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
161 dom=`echo $$dlang | sed -e 's/\..*$$//'`; \
162 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
163 if test -f $${dlang}.po; then \
164 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${dlang}.po $${dom}.pot"; \
165 cd $(srcdir) && $(MSGMERGE_UPDATE) $${dlang}.po $${dom}.pot; \
168 # @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
169 # test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
170 # echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(FVWM_DOMAIN).pot"; \
171 # cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(FVWM_DOMAIN).pot
173 install-data-local: install-data-local-@USE_NLS@
174 install-data-local-no: all
175 install-data-local-yes: all
176 $(mkinstalldirs) $(DESTDIR)$(datadir)
177 @catalogs='$(CATALOGS)'; \
178 all_domains='$(ALL_DOMAINS)'; \
179 for dom in $$all_domains; do \
180 for cat in $$catalogs; do \
181 cat=`basename $$cat`; \
182 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
184 dir=$(localedir)/$$lang/LC_MESSAGES; \
185 $(mkinstalldirs) $(DESTDIR)$$dir; \
187 then realcat=$$cat; \
188 else realcat=$(srcdir)/$$cat; \
190 if test -f $$realcat; then \
191 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$$dom.mo; \
192 echo "installing $$realcat as $(DESTDIR)$$dir/$$dom.mo"; \
193 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
194 if test -n "$$lc"; then \
195 if (cd $(DESTDIR)$(localedir)/$$lang && \
196 LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' \
198 link=`cd $(DESTDIR)$(localedir)/$$lang && \
199 LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
200 mv $(DESTDIR)$(localedir)/$$lang/$$lc \
201 $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
202 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
203 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
205 if test -f $$file; then \
206 ln -s ../$$link/$$file \
207 $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
210 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
212 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
215 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
216 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
219 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \
220 ln -s ../LC_MESSAGES/$$dom.mo \
221 $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo 2>/dev/null || \
222 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$dom.mo \
223 $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo 2>/dev/null || \
224 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$dom.mo \
225 $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \
226 echo "installing $$realcat link as \
227 $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo"; \
235 installdirs-data: installdirs-data-local-@USE_NLS@
236 installdirs-data-local-no:
237 installdirs-data-local-yes:
238 $(mkinstalldirs) $(DESTDIR)$(datadir)
239 @catalogs='$(CATALOGS)'; \
240 all_domains='$(ALL_DOMAINS)'; \
241 for dom in $$all_domainss; do \
242 for cat in $$catalogs; do \
243 cat=`basename $$cat`; \
244 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
245 dir=$(localedir)/$$lang/LC_MESSAGES; \
246 $(mkinstalldirs) $(DESTDIR)$$dir; \
247 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
248 if test -n "$$lc"; then \
249 if (cd $(DESTDIR)$(localedir)/$$lang && \
250 LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' \
252 link=`cd $(DESTDIR)$(localedir)/$$lang && \
253 LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
254 mv $(DESTDIR)$(localedir)/$$lang/$$lc \
255 $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
256 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
257 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
259 if test -f $$file; then \
260 ln -s ../$$link/$$file \
261 $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
264 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
266 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
269 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
270 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
279 uninstall-local: uninstall-local-@USE_NLS@
282 catalogs='$(CATALOGS)'; \
283 all_domains='$(ALL_DOMAINS)'; \
284 for dom in $$all_domains; do \
285 for cat in $$catalogs; do \
286 cat=`basename $$cat`; \
287 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
288 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
289 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \
295 $(MAKE) $(FVWM_DOMAIN).pot-update
296 $(MAKE) $(FVWMTASKBAR_DOMAIN).pot-update
297 $(MAKE) $(FVWMSCRIPT_DOMAIN).pot-update
298 $(MAKE) $(UPDATEPOFILES)
301 # General rule for updating PO files.
304 dlang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po-update$$//'`; \
305 dom=`echo $$dlang | sed -e 's/\..*$$//'`; \
308 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
309 echo "$${cdcmd}$(MSGMERGE) $$dlang.po $$dom.pot -o $$dlang.new.po"; \
311 if $(MSGMERGE) $$dlang.po $$dom.pot -o $$tmpdir/$$dlang.new.po; then \
312 if cmp $$dlang.po $$tmpdir/$$dlang.new.po >/dev/null 2>&1; then \
313 rm -f $$tmpdir/$$dlang.new.po; \
315 if mv -f $$tmpdir/$$dlang.new.po $$dlang.po; then \
318 echo "msgmerge for $$dlang.po failed: cannot move \
319 $$tmpdir/$$dlang.new.po to $$dlang.po" 1>&2; \
324 echo "msgmerge for $$dlang.po failed!" 1>&2; \
325 rm -f $$tmpdir/$$dlang.new.po; \
330 update-gmo: Makefile $(GMOFILES)