diff --git a/ChangeLog b/ChangeLog index 62da22b60..89db99c9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 2003-02-06 Henning Meier-Geinitz * Makefile.in: Added ChangeLog-1.0.10 to DISTFILES. + * po/Makefile.in po/template.desc po/README: Don't generate po files + with every make. That avoids recreation just because of date changes. + Automatically create new languages on make update. Automatically + generate list of DISTFILES. Added template for header used in new + po files. Updated documentation. 2003-02-05 Henning Meier-Geinitz diff --git a/po/Makefile.in b/po/Makefile.in index e1276ba0f..79a2b97ee 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -17,8 +17,8 @@ SRC_FILES = ../include/sane/saneopts.h ../backend/artec_eplus48u.c \ ../backend/teco3.h ../backend/test.c ../backend/umax1220u.c \ ../backend/umax.c ../backend/umax_pp.c -DISTFILES = Makefile.in README sane-backends.de.po sane-backends.pt.po \ - sane-backends.es.po sane-backends.fr.po sane-backends.ru.po sane-backends.sv.po +DISTFILES = Makefile.in README template.po \ + $(foreach lang,$(ALL_LINGUAS),sane-backends.$(lang).po) # End of configuration section @@ -55,7 +55,7 @@ TMP_FILE_DIR = .tmp DISTCLEAN_FILES = @DISTCLEAN_FILES@ .PHONY: all clean depend dist distclean install install-translations \ - uninstall uninstall-translations all-mos + uninstall uninstall-translations all-mos update all: $(ALL) @@ -76,11 +76,18 @@ sane-backends.pot: $(SRC_FILES) @$(XGETTEXT) -dsane-backends -kSANE_I18N $(TMP_FILE_DIR)/*.* @mv sane-backends.po sane-backends.pot -sane-backends.%.po: sane-backends.pot - @echo "updating $@" - @cp $@ $@.old - @$(MSGMERGE) $@.old $< -o $@ - @rm -f $@.old +update: sane-backends.pot + @for lang in $(ALL_LINGUAS) ; do \ + pofile=sane-backends.$${lang}.po ; \ + if test ! -f $${pofile} ; then \ + echo "creating $${pofile}" ; \ + cp template.po $${pofile} ; \ + fi ; \ + echo "updating $${pofile}" ; \ + cp $${pofile} $${pofile}.old ; \ + $(MSGMERGE) $${pofile}.old $< -o $${pofile} ; \ + rm -f $${pofile}.old ; \ + done install-translations: @for lang in $(ALL_LINGUAS) ; do \ diff --git a/po/README b/po/README index 36d28d622..875e7f91c 100644 --- a/po/README +++ b/po/README @@ -1,65 +1,69 @@ -2002-12-02 +2003-02-06 This directory contains translations for the options of the SANE backends. They are only used if the gettext tools are found by configure. You will need GNU gettext: xgettext, msgfmt and msgmerge. The translations are used at least by the frontends XSane and quiteinsane. -What do you need to do if you want to: -- Just read the description of SANE options in your language - * Use XSane or your favourite frontend that supports translations, read the - documentation and set LANG to your local setting (e.g. de_DE for German - language in Germany). Make sure, that you use a recent version of the - frontends. +Users: I want to just read the description of SANE options in my language +------------------------------------------------------------------------- -- Update existing translations when the source code has changed - * cd po ; make - * Edit sane-backends.lang.po, add/change translations. (with lang = your - language, e.g. "de") - * make install +Use XSane (>=0.90) or your favourite frontend that supports translations, read +the documentation and set the environment variable LANG to your local setting. +Example for German: export LANG=de_DE ; xsane -- Add a new language - * Edit po/Makefile.in, add your language to ALL_LINGUAS and add - sane-backends.lang.po to DISTFILES. - * ./configure - * cd po - * touch sane-backends.lang.po - * make - * Edit sane-backends.lang.po and enter translations. You only need to enter - the translations for texts actually used by your backend but the more you - can translate, the better. Don't forget to edit the headers. UTF-8 is the - preferred encoding. - * make install -- Add a translation for a completely untranslated backend - * Edit the source code of the backend and add SANE_I18N to the appropriate - strings. Mark the descriptions (desc) and titles of options with - SANE_I18N(). Do the same for string lists used in options. The name of - options must NOT be marked. Do NOT mark macros. Especially you don't need - to mark standard option strings like SANE_TITLE_NUM_OPTIONS as this is - already done in saneopts.h. - Examples: s->opt[5].title = SANE_I18N("Enhancement"); - #define STANDARD_FORMAT SANE_I18N("a4 Paper") - * Edit po/Makefile.in. Add all soucecode files that conatain strings marked - by SANE_I18N() to SRC_FILES. - * If you want to also add a new language, see above. - * ./configure - * cd po ; make - * Edit sane-backends.lang.po, enter translations. Add your name/email address - to the header. If you don't agree with an already existing translation, ask - the sane-devel mailing list. - * make install +Translators: I want to update existing translations +--------------------------------------------------- + +* cd po ; make update +* Edit sane-backends.lang.po, add/change translations. (with lang = your + language, e.g. "de"). You need an editor that is capable of using the + encoding UTF8 (unicode). +* Add your name to the header. Update the "last translator" field. +* make ; make install + + +Translators: I want to add a new language +----------------------------------------- + +* Edit po/Makefile.in, add your language to ALL_LINGUAS. +* ./configure +* Go ahead with "I want to update existing translations". + + +Backend developers: I want to add internationalization support for my backend +----------------------------------------------------------------------------- + +* Edit the source code of the backend and add SANE_I18N to the appropriate + strings. Mark the descriptions (desc) and titles of options with + SANE_I18N(). Do the same for string lists used in options. The name of + options must NOT be marked. Do NOT mark macros. Especially you don't need + to mark standard option strings like SANE_TITLE_NUM_OPTIONS as this is + already done in saneopts.h. + Examples: s->opt[5].title = SANE_I18N("Enhancement"); + #define STANDARD_FORMAT SANE_I18N("a4 Paper") +* Edit po/Makefile.in. Add all source code files that contain strings marked + by SANE_I18N() to SRC_FILES. +* If you want to also add a new language, see above. +* ./configure +* See "Update existing translations" or "Add a new language". + + +Frontend developers: I want to add internationalization support for my frontend +------------------------------------------------------------------------------- + +* The Makefile installs files called "sane-backends.mo" in the directory + "$(prefix)/share/locale/lang/LC_MESSAGES/", e.g.: + "/usr/local/share/locale/de/LC_MESSAGES/sane-backends.mo". For every + language exactly one .mo file is installed. Earlier releases of + sane-backends installed one file per backend, e.g. sane-umax.mo. For + backward compatibility, frontends may want to check for these files, also. +* As mentioned above, GNU gettext is used. +* With other NLS implementations, converting the mo files may work. + -- Add support in your frontend: - * The Makefile installs files called "sane-backends.mo" in the directory - "$(prefix)/share/locale/lang/LC_MESSAGES/", e.g.: - "/usr/local/share/locale/de/LC_MESSAGES/sane-backends.mo". For every - language exactly one .mo file is installed. Earlier releases of - sane-backends installed one file per backend, e.g. sane-umax.mo. For - backward compatibility, frontends may want to check for these files, also. - * As mentioned above, GNU gettext is used. - * With other NLS implementations, converting the mo files may work. Bugs: - Using sed to include macros into *.pot isn't nice. diff --git a/po/template.po b/po/template.po new file mode 100644 index 000000000..ebd7d2d7b --- /dev/null +++ b/po/template.po @@ -0,0 +1,13 @@ +# [insert language here] translation for SANE backend options +# Copyright (C) SANE Project. +# [name of translator], [insert email address here], [year]. +msgid "" +msgstr "" +"Project-Id-Version: sane-backends 1.0.11\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: [name] [email-address]\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n"