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.
merge-requests/1/head
Henning Geinitz 2003-02-06 21:26:16 +00:00
rodzic 0051beb25f
commit 4fa2a7510d
4 zmienionych plików z 88 dodań i 59 usunięć

Wyświetl plik

@ -1,6 +1,11 @@
2003-02-06 Henning Meier-Geinitz <henning@meier-geinitz.de>
* 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 <henning@meier-geinitz.de>

Wyświetl plik

@ -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 \

106
po/README
Wyświetl plik

@ -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.

13
po/template.po 100644
Wyświetl plik

@ -0,0 +1,13 @@
# [insert language here] translation for SANE backend options
# Copyright (C) <year> 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"