1 # Convenient makefile for managing translations.
7 # Adding new translations
8 # -----------------------
10 # To start working on a new translation edit the POS=... line
11 # below. If you want to add for example a french translation, add
14 # Then run "make po" to generate a fresh .po file from translatable
15 # strings in t_options.h. Now you can edit the new .po file (fr.po in
16 # the example above) to translate the strings. Please make sure that
17 # your editor encodes the file in UTF-8.
19 # Updating existing translations
20 # ------------------------------
22 # Run "make po" to update .po files with new translatable strings from
23 # t_options.h. Now you can edit the .po files you're interested
24 # in. Please make sure that your editor encodes the file in UTF-8.
29 # Finally run "make" to generate options.h from t_options.h with all
30 # translations. Now you can rebuild the drivers. Any common options
31 # used by the drivers will have option descriptions with the latest
34 # Publishing translations
35 # -----------------------
37 # To get your translation(s) into Mesa CVS, please send me your
43 # The set of supported languages. Add languages as needed.
44 POS=ca.po de.po es.po nl.po fr.po sv.po
47 # Don't change anything below, unless you know what you're doing.
50 MOS=$(POS:%.po=%/LC_MESSAGES/options.mo)
53 .PHONY: all clean pot po mo
66 BUILT_SOURCES = options.h
72 # Default target options.h
74 options.h: t_options.h $(MOS)
75 $(AM_V_GEN) $(PYTHON) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py $(srcdir)/t_options.h $(LOCALEDIR) $(LANGS) > options.h
77 # Update .mo files from the corresponding .po files.
78 %/LC_MESSAGES/options.mo: %.po
81 echo "Updating ($$lang) $@ from $?."; \
82 $(MKDIR_P) $$lang/LC_MESSAGES; \
85 # Use this target to create or update .po files with new messages in
88 @for po in $(POS); do \
89 if [ -f $$po ]; then \
90 echo "Merging new strings from $(POT) into $@."; \
92 msgmerge -o $$po $$po~ $(POT); \
94 echo "Initializing $$po from $(POT)."; \
95 msginit -i $(POT) -o $$po~ --locale=$*; \
96 sed -e 's/charset=.*\\n/charset=UTF-8\\n/' $$po~ > $$po; \
102 # Extract message catalog from driconf.py.
104 xgettext -L C --from-code utf-8 -o $(POT) t_options.h