kopia lustrzana https://gitlab.com/sane-project/backends
Use only one file of translated messages per language. Merged all backend
files. Uses UTF-8 everywhere. Updated all files from the marked source code.DEVEL_2_0_BRANCH-1
rodzic
eefbee1252
commit
e42a7af6a3
|
@ -1,3 +1,11 @@
|
|||
2002-12-02 Henning Meier-Geinitz <henning@meier-geinitz.de>
|
||||
|
||||
* po/Makefile.in po/README sane-backends.de.po sane-backends.es.po
|
||||
sane-backends.fr.po sane-backends.ru.po sane-backends.sv.po:
|
||||
Use only one file of translated messages per language. Merged
|
||||
all backend files. Uses UTF-8 everywhere. Updated all files
|
||||
from the marked source code.
|
||||
|
||||
2002-12-01 Stéphane Voltz <svoltz@wanadoo.fr>
|
||||
|
||||
* backend/umax_pp.c: unmarked from SANE_I18N 2 options names
|
||||
|
|
122
po/Makefile.in
122
po/Makefile.in
|
@ -1,25 +1,26 @@
|
|||
# po/Makefile.in
|
||||
# See po/README for documentation.
|
||||
|
||||
ALL_LINGUAS = de es fr ru sv
|
||||
|
||||
SRC_FILES = ../include/sane/saneopts.h ../backend/artec_eplus48u.c \
|
||||
../backend/avision.h \
|
||||
../backend/canon630u.c ../backend/epson.c ../backend/epson.h \
|
||||
../backend/gt68xx.c ../backend/leo.c ../backend/leo.h \
|
||||
../backend/matsushita.c ../backend/matsushita.h ../backend/mustek.c \
|
||||
../backend/mustek_usb.c ../backend/plustek.c ../backend/pnm.c \
|
||||
../backend/sceptre.c ../backend/sceptre.h ../backend/snapscan.c \
|
||||
../backend/snapscan-options.c ../backend/teco1.c ../backend/teco1.h \
|
||||
../backend/teco2.c ../backend/teco2.h ../backend/teco3.c \
|
||||
../backend/teco3.h ../backend/test.c ../backend/umax1220u.c \
|
||||
../backend/umax.c ../backend/umax_pp.c
|
||||
|
||||
DISTFILES = Makefile.in README sane-backends.pot sane-backends.de.po \
|
||||
sane-backends.es.po sane-backends.fr.po sane-backends.ru.po sane-backends.sv.po
|
||||
|
||||
# End of configuration section
|
||||
|
||||
SHELL = /bin/sh
|
||||
all: check-mo
|
||||
|
||||
# Create one line per backend with all files containing translatable text:
|
||||
artec_eplus48u.*.po: ../backend/artec_eplus48u.c
|
||||
epson.*.po: ../backend/epson.c ../backend/epson.h
|
||||
gt68xx.*.po: ../backend/gt68xx.c
|
||||
matsushita.*.po: ../backend/matsushita.c ../backend/matsushita.h
|
||||
mustek.*.po: ../backend/mustek.c
|
||||
mustek_usb.*.po: ../backend/mustek_usb.c
|
||||
plustek.*.po: ../backend/plustek.c ../backend/plustek.h
|
||||
pnm.*.po: ../backend/pnm.c
|
||||
teco1.*.po: ../backend/teco1.c ../backend/teco1.h
|
||||
umax.*.po: ../backend/umax.c
|
||||
umax_pp.*.po: ../backend/umax_pp.c
|
||||
sceptre.*.po: ../backend/sceptre.c ../backend/sceptre.h
|
||||
snapscan.*.po: ../backend/snapscan.c
|
||||
|
||||
# end of configuration
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = @datadir@
|
||||
|
@ -35,7 +36,7 @@ distdir = $(top_srcdir)/$(PACKAGE)-$(VERSION)
|
|||
INSTALL_TRANSLATIONS = @INSTALL_TRANSLATIONS@
|
||||
ifeq ($(INSTALL_TRANSLATIONS),install-translations)
|
||||
UNINSTALL_TRANSLATIONS = uninstall-translations
|
||||
UPDATE_MO = update-mo
|
||||
ALL = all-mos
|
||||
endif
|
||||
|
||||
MKDIR = $(top_srcdir)/mkinstalldirs
|
||||
|
@ -50,83 +51,43 @@ MSGCAT = @MSGCAT@
|
|||
|
||||
TMP_FILE_DIR = .tmp
|
||||
|
||||
ALL_POS = $(wildcard *.po)
|
||||
ALL_BACKENDS = $(sort $(basename $(basename $(ALL_POS))))
|
||||
ALL_POTS = $(addsuffix .pot,$(ALL_BACKENDS))
|
||||
ALL_MOS = $(filter-out saneopts.%.mo,$(addsuffix .mo,$(basename $(ALL_POS))))
|
||||
ALL_LINGUAS = $(sort $(subst .,,$(suffix $(basename $(ALL_POS)))))
|
||||
|
||||
DISTCLEAN_FILES = @DISTCLEAN_FILES@
|
||||
|
||||
DISTFILES = Makefile.in README epson.de.po epson.ru.po gt68xx.de.po \
|
||||
mustek.de.po mustek.ru.po mustek_usb.de.po mustek_usb.ru.po \
|
||||
matsushita.fr.po matsushita.ru.po \
|
||||
plustek.de.po plustek.ru.po plustek.es.po \
|
||||
pnm.de.po pnm.ru.po \
|
||||
saneopts.de.po saneopts.ru.po saneopts.fr.po saneopts.es.po \
|
||||
sceptre.fr.po sceptre.ru.po teco1.fr.po teco1.ru.po \
|
||||
umax.de.po umax.fr.po umax.ru.po umax_pp.fr.po umax_pp.ru.po umax_pp.de.po \
|
||||
snapscan.de.po snapscan.ru.po artec_eplus48u.de.po \
|
||||
saneopts.sv.po epson.sv.po
|
||||
|
||||
.PHONY: all clean depend dist distclean install install-translations \
|
||||
uninstall update-mo update-po generate-%
|
||||
uninstall uninstall-translations all-mos
|
||||
|
||||
.SUFFIXES: .po .mo
|
||||
all: $(ALL)
|
||||
|
||||
saneopts.*.po: ../include/sane/saneopts.h
|
||||
all-mos: $(foreach lang,$(ALL_LINGUAS),sane-backends.$(lang).mo)
|
||||
|
||||
# backend.lang.po -> backend.lang.mo; include saneopts.??.po
|
||||
%.mo:
|
||||
@lang=$(subst .,,$(suffix $(basename $(subst install-,,$@)))) ; \
|
||||
echo generating $@ from $*.po and saneopts.$${lang}.po ; \
|
||||
if test $(MSGCAT) = no ; then \
|
||||
$(MSGFMT) -o $@ $*.po saneopts.$${lang}.po ; \
|
||||
else \
|
||||
$(MSGCAT) --use-first $*.po saneopts.$${lang}.po \
|
||||
| $(MSGFMT) -o $@ - ; \
|
||||
fi
|
||||
%.mo: %.po
|
||||
@echo "generating $@ from $^"
|
||||
@$(MSGFMT) -o $@ $^
|
||||
|
||||
|
||||
# Sourcefiles -> backend.lang.po (updating po)
|
||||
$(foreach lang,$(ALL_LINGUAS),%.$(lang).po):
|
||||
@echo -n "updating $@ from $^ "
|
||||
sane-backends.pot: $(SRC_FILES)
|
||||
@echo "creating $@ from $^"
|
||||
@rm -rf $(TMP_FILE_DIR)
|
||||
@mkdir $(TMP_FILE_DIR) && \
|
||||
for file in $^ ; do \
|
||||
sed < $${file} -e 's/#define//g' \
|
||||
> $(TMP_FILE_DIR)/`basename $${file}` ; \
|
||||
done
|
||||
@$(XGETTEXT) -d$* -kSANE_I18N $(TMP_FILE_DIR)/*.*
|
||||
@mv $*.po $*.pot
|
||||
@$(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 $*.pot -o $@
|
||||
@$(MSGMERGE) $@.old $< -o $@
|
||||
@rm -f $@.old
|
||||
|
||||
# Generate new po file
|
||||
%-gen:
|
||||
@if test ! -e $* ; then \
|
||||
touch $* -d "1980-01-01" ; \
|
||||
echo created new file: $* ; \
|
||||
$(MAKE) $* ; \
|
||||
fi
|
||||
|
||||
update-po: $(ALL_POS)
|
||||
|
||||
update-mo: $(ALL_MOS)
|
||||
|
||||
check-mo: $(UPDATE_MO)
|
||||
|
||||
$(addprefix install-,$(ALL_MOS)):
|
||||
@mo_file=$(subst install-,,$@) ; \
|
||||
backend=$(basename $(basename $(subst install-,,$@))) ; \
|
||||
lang=$(subst .,,$(suffix $(basename $(subst install-,,$@)))) ; \
|
||||
dir=$(gnulocaledir)/$${lang}/LC_MESSAGES ; \
|
||||
echo installing $${mo_file} to $${dir}/sane-$${backend}.mo... ; \
|
||||
install-translations:
|
||||
@for lang in $(ALL_LINGUAS) ; do \
|
||||
dir=$(gnulocaledir)/$${lang}/LC_MESSAGES ; \
|
||||
echo "installing sane-backends.$${lang}.mo to $${dir}/sane-backends.mo..." ; \
|
||||
$(MKDIR) $(DESTDIR)$${dir} && \
|
||||
$(INSTALL_DATA) $${mo_file} $(DESTDIR)$${dir}/sane-$${backend}.mo ;
|
||||
|
||||
install-translations: $(addprefix install-,$(ALL_MOS))
|
||||
$(INSTALL_DATA) sane-backends.$${lang}.mo $(DESTDIR)$${dir}/sane-backends.mo ; \
|
||||
done
|
||||
|
||||
install: $(INSTALL_TRANSLATIONS)
|
||||
|
||||
|
@ -146,7 +107,6 @@ clean:
|
|||
distclean: clean
|
||||
rm -f $(DISTCLEAN_FILES)
|
||||
rm -f Makefile
|
||||
rm -f *.pot
|
||||
rm -rf $(TMP_FILE_DIR)
|
||||
|
||||
depend:
|
||||
|
|
81
po/README
81
po/README
|
@ -1,4 +1,4 @@
|
|||
2002-11-03
|
||||
2002-12-02
|
||||
|
||||
This directory contains translations for the options of the SANE backends.
|
||||
They are only used if the gettext tools are found by configure.
|
||||
|
@ -10,51 +10,56 @@ 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).
|
||||
language in Germany). Make sure, that you use a recent version of the
|
||||
frontends.
|
||||
|
||||
- Update existing translations when the source code has changed
|
||||
* cd po ; make backend.lang.po
|
||||
* Edit backend.lang.po, add/change translations. (with lang = your
|
||||
language, e.g. "de", and backend = your backend, e.g. mustek)
|
||||
* make ; make install
|
||||
* cd po ; make
|
||||
* Edit sane-backends.lang.po, add/change translations. (with lang = your
|
||||
language, e.g. "de")
|
||||
* make install
|
||||
|
||||
- Add a new language to an existing backend
|
||||
* cd po ; make backend.lang.po-gen
|
||||
* If no other backend uses this language, you must also create
|
||||
saneopts.lang.po: make saneopts.lang.po-gen.
|
||||
* Edit backend.lang.po, and saneopts.lang.po, enter translations. You only
|
||||
need to enter the translations for texts actually used by your backend.
|
||||
Don't forget to edit the headers.
|
||||
* Edit Makefile.in, add backend.lang.po (and saneopts.lang.po if it's not
|
||||
yet there) to DISTFILES.
|
||||
* make ; make install
|
||||
|
||||
- Add a translation for a backend that is not listed yet in Makefile.in
|
||||
* Edit your sources 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.
|
||||
Example: s->opt[5].title = SANE_I18N("Enhancement");
|
||||
* Edit po/Makefile.in. Add a line "backend.*.po: yourfiles" where
|
||||
yourfiles is a space-separated list of all your files containing
|
||||
translatable text. Also add backend.lang.po to DISTFILES.
|
||||
- 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 ; make backend.lang.po-gen
|
||||
* see above, if the language isn't used by other backends.
|
||||
* Edit backend-lang.po, enter translations. Don't forget to edit the header.
|
||||
* make ; make install
|
||||
* 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
|
||||
|
||||
- Add support in your frontend:
|
||||
* The Makefile installs files called "sane-backend.mo" in the directory
|
||||
* 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-umax.mo". For every backend
|
||||
and every language exactly one .mo file is installed, if the
|
||||
correspondent .po file is available.
|
||||
"/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:
|
||||
- I used sed to also include macros into *.pot.
|
||||
- All well known options are added to *.lang.po even if they are not used
|
||||
in the backend.
|
||||
- Using sed to include macros into *.pot isn't nice.
|
||||
|
|
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue