1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Improved the 'i18n' target in plugin Makefiles

This commit is contained in:
Klaus Schmidinger 2007-11-04 11:00:16 +01:00
parent 993235bdcc
commit 7823790beb
5 changed files with 48 additions and 46 deletions

View File

@ -5511,4 +5511,6 @@ Video Disk Recorder Revision History
in using tr(FileNameChars) (suggested by Thomas Günther). in using tr(FileNameChars) (suggested by Thomas Günther).
- Added a missing '.' to the date returned by DayDateTime() (thanks to Lauri Nurmi). - Added a missing '.' to the date returned by DayDateTime() (thanks to Lauri Nurmi).
- Improved the 'i18n' target in the Makefile to avoid unnecessary work (thanks to - Improved the 'i18n' target in the Makefile to avoid unnecessary work (thanks to
Stefan Huelswitt). Stefan Huelswitt). The 'newplugin' and 'i18n-to-gettext.pl' scripts have been
changed accordingly. Plugin authors may want to adjust the 'i18n' target
of their Makefiles.

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # Makefile for a Video Disk Recorder plugin
# #
# $Id: Makefile 1.20 2007/10/14 09:23:04 kls Exp $ # $Id: Makefile 1.21 2007/11/04 10:52:15 kls Exp $
# The official name of this plugin. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -72,25 +72,25 @@ $(DEPFILE): Makefile
PODIR = po PODIR = po
LOCALEDIR = $(VDRDIR)/locale LOCALEDIR = $(VDRDIR)/locale
I18Npo = $(wildcard $(PODIR)/*.po) I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file))))
I18Npot = $(PODIR)/$(PLUGIN).pot I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po %.mo: %.po
msgfmt -c -o $@ $< msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.c) $(I18Npot): $(wildcard *.c)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<vdr-bugs@cadsoft.de>' -o $@ $(wildcard *.c) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<vdr-bugs@cadsoft.de>' -o $@ $^
$(I18Npo): $(I18Npot) %.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q $@ $< msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
@touch $@
i18n: $(I18Npot) $(I18Nmo) $(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@mkdir -p $(LOCALEDIR) @mkdir -p $(dir $@)
for i in $(I18Ndirs); do\ cp $< $@
mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\ .PHONY: i18n
done i18n: $(I18Nmsgs)
### Targets: ### Targets:

View File

@ -1,7 +1,7 @@
# #
# Makefile for a Video Disk Recorder plugin # Makefile for a Video Disk Recorder plugin
# #
# $Id: Makefile 1.13 2007/10/14 09:23:25 kls Exp $ # $Id: Makefile 1.14 2007/11/04 10:52:13 kls Exp $
# The official name of this plugin. # The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin. # This name will be used in the '-P...' option of VDR to load the plugin.
@ -70,25 +70,25 @@ $(DEPFILE): Makefile
PODIR = po PODIR = po
LOCALEDIR = $(VDRDIR)/locale LOCALEDIR = $(VDRDIR)/locale
I18Npo = $(wildcard $(PODIR)/*.po) I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file))))
I18Npot = $(PODIR)/$(PLUGIN).pot I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po %.mo: %.po
msgfmt -c -o $@ $< msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.c) $(I18Npot): $(wildcard *.c)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<vdr-bugs@cadsoft.de>' -o $@ $(wildcard *.c) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<vdr-bugs@cadsoft.de>' -o $@ $^
$(I18Npo): $(I18Npot) %.po: $(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q $@ $< msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
@touch $@
i18n: $(I18Npot) $(I18Nmo) $(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@mkdir -p $(LOCALEDIR) @mkdir -p $(dir $@)
for i in $(I18Ndirs); do\ cp $< $@
mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\ .PHONY: i18n
done i18n: $(I18Nmsgs)
### Targets: ### Targets:

View File

@ -10,7 +10,7 @@
# See the main source file 'vdr.c' for copyright information and # See the main source file 'vdr.c' for copyright information and
# how to reach the author. # how to reach the author.
# #
# $Id: i18n-to-gettext.pl 1.5 2007/10/14 09:29:59 kls Exp $ # $Id: i18n-to-gettext.pl 1.6 2007/11/04 10:57:36 kls Exp $
# How to convert an actual plugin: # How to convert an actual plugin:
# #
@ -306,25 +306,25 @@ $MAKEI18N = q{### Internationalization (I18N):
PODIR = po PODIR = po
LOCALEDIR = $(VDRDIR)/locale LOCALEDIR = $(VDRDIR)/locale
I18Npo = $(wildcard $(PODIR)/*.po) I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file))))
I18Npot = $(PODIR)/$(PLUGIN).pot I18Npot = $(PODIR)/$(PLUGIN).pot
%.mo: %.po %.mo: %.po
msgfmt -c -o $@ $< msgfmt -c -o $@ $<
$(I18Npot): $(wildcard *.c) $(I18Npot): $(wildcard *.c)
xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP --msgid-bugs-address='<} . $MSGIDBUGS . q{>' -o $@ $(wildcard *.c) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<} . $MSGIDBUGS . q{>' -o $@ $^
$(I18Npo): $(I18Npot) %.po: $(I18Npot)
msgmerge -U --no-wrap -F --backup=none -q $@ $< msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
@touch $@
i18n: $(I18Npot) $(I18Nmo) $(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
@mkdir -p $(LOCALEDIR) @mkdir -p $(dir $@)
for i in $(I18Ndirs); do\ cp $< $@
mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\
cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\ .PHONY: i18n
done i18n: $(I18Nmsgs)
}; };

View File

@ -12,7 +12,7 @@
# See the main source file 'vdr.c' for copyright information and # See the main source file 'vdr.c' for copyright information and
# how to reach the author. # how to reach the author.
# #
# $Id: newplugin 1.38 2007/10/14 09:13:17 kls Exp $ # $Id: newplugin 1.39 2007/11/04 10:42:52 kls Exp $
$PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n"; $PLUGIN_NAME = $ARGV[0] || die "Usage: newplugin <name>\n";
@ -131,25 +131,25 @@ DEPFILE = .dependencies
PODIR = po PODIR = po
LOCALEDIR = \$(VDRDIR)/locale LOCALEDIR = \$(VDRDIR)/locale
I18Npo = \$(wildcard \$(PODIR)/*.po) I18Npo = \$(wildcard \$(PODIR)/*.po)
I18Nmo = \$(addsuffix .mo, \$(foreach file, \$(I18Npo), \$(basename \$(file)))) I18Nmsgs = \$(addprefix \$(LOCALEDIR)/, \$(addsuffix /LC_MESSAGES/vdr-\$(PLUGIN).mo, \$(notdir \$(foreach file, \$(I18Npo), \$(basename \$(file))))))
I18Ndirs = \$(notdir \$(foreach file, \$(I18Npo), \$(basename \$(file))))
I18Npot = \$(PODIR)/\$(PLUGIN).pot I18Npot = \$(PODIR)/\$(PLUGIN).pot
%.mo: %.po %.mo: %.po
msgfmt -c -o \$\@ \$< msgfmt -c -o \$\@ \$<
\$(I18Npot): \$(wildcard *.c) \$(I18Npot): \$(wildcard *.c)
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o \$\@ \$(wildcard *.c) xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<see README>' -o \$\@ \$^
\$(I18Npo): \$(I18Npot) %.po: \$(I18Npot)
msgmerge -U --no-wrap --no-location --backup=none -q \$\@ \$< msgmerge -U --no-wrap --no-location --backup=none -q \$\@ \$<
\@touch \$\@
i18n: \$(I18Npot) \$(I18Nmo) \$(I18Nmsgs): \$(LOCALEDIR)/%/LC_MESSAGES/vdr-\$(PLUGIN).mo: \$(PODIR)/%.mo
\@mkdir -p \$(LOCALEDIR) \@mkdir -p \$(dir \$@)
for i in \$(I18Ndirs); do\\ cp \$< \$\@
mkdir -p \$(LOCALEDIR)/\$\$i/LC_MESSAGES;\\
cp \$(PODIR)/\$\$i.mo \$(LOCALEDIR)/\$\$i/LC_MESSAGES/vdr-\$(PLUGIN).mo;\\ .PHONY: i18n
done i18n: \$(I18Nmsgs)
### Targets: ### Targets: