diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-08-19 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-08-19 18:00:00 +0200 |
commit | e5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70 (patch) | |
tree | cb794be1f7796ccbfdd1ce04bca0d75d997ead0b /i18n-to-gettext.pl | |
parent | 4c65b525dc1e3c62336b223d200a46fb30dc7e52 (diff) | |
download | vdr-patch-lnbsharing-e5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70.tar.gz vdr-patch-lnbsharing-e5a2aa41c9762bda4ce7b987aba1bcfa1cee6f70.tar.bz2 |
Version 1.5.8vdr-1.5.8
- Added missing install-i18n to the install target in the Makefile (reported
by Joachim Wilke).
- Fixed a faulty comment in Make.config.template (reported by Marco Schlüßler).
- Improved i18n-to-gettext.pl (thanks to Matthias Schwarzott).
- Moved the "all" target in plugin Makefiles before the "Implicit rules",
so that a plain "make" will compile everything (suggested by Matthias
Schwarzott). The "newplugin" script has been changed accordingly.
Plugin authors may want to change their Makefiles, too.
- Added DESTDIR and PREFIX handling to the Makefile (thanks to Matthias
Schwarzott).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Added internationalization to the "skincurses" plugin (thanks to Rolf
Ahrenberg).
- Checking the string for NULL in I18nTranslate().
- Updated the French OSD texts (thanks to Bruno Roussel).
- Some optimizations in cDvbDevice::SetChannelDevice() (thanks to Tobias Bratfisch).
- Optimized cMenuEditChrItem::Set() (thanks to Tobias Bratfisch).
- Optimized cNitFilter::Process() (thanks to Tobias Bratfisch).
- Reduced the number of time(NULL) calls in vdr.c's main loop to a single call
(thanks to Tobias Bratfisch).
- Changed cBitmap::DrawText() to always draw the background unless ColorBg
is clrTransparent (thanks to Christoph Haubrich).
- The "Setup/OSD/Language" menu now only shows those languages that actually
have a locale (suggested by Anssi Hannula).
- Now using setenv() instead of setlocale() to set the language for gettext()
(suggested by Anssi Hannula; thanks also to Ludwig Nussel for a hint on using
_nl_msg_cat_cntr).
- When scanning the locale directory, VDR now explicitly looks for a file named
vdr.mo. Text files for plugins are now named "vdr-name.mo", when "name" is the
name of the plugin. The "newplugin" script has been changed accordingly, and
plugin authors should change their Makefiles, too.
Diffstat (limited to 'i18n-to-gettext.pl')
-rwxr-xr-x | i18n-to-gettext.pl | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/i18n-to-gettext.pl b/i18n-to-gettext.pl index 79b2aab..130122d 100755 --- a/i18n-to-gettext.pl +++ b/i18n-to-gettext.pl @@ -10,7 +10,7 @@ # See the main source file 'vdr.c' for copyright information and # how to reach the author. # -# $Id: i18n-to-gettext.pl 1.2 2007/08/12 10:02:01 kls Exp $ +# $Id: i18n-to-gettext.pl 1.3 2007/08/15 12:52:00 kls Exp $ # How to convert an actual plugin: # @@ -75,7 +75,7 @@ die "can't find plugin name!" unless ($PLUGIN); # Locate the file containing the texts: $I18NFILE = ""; -for ("i18n.c", `ls *.c`) { # try i18n.c explicitly first +for ("i18n.c", "i18n.h", `ls *.c`) { # try i18n.[ch] explicitly first chomp($f = $_); if (-f $f && `grep tI18nPhrase $f`) { $I18NFILE = $f; @@ -204,13 +204,28 @@ $POTFILE = "$PODIR/$PLUGIN.pot"; # Collect all translated texts: open(F, $I18NFILE) || die "$I18NFILE: $!\n"; +$InComment = 0; while (<F>) { chomp; s/\t/ /g; # get rid of tabs s/ *$//; # get rid of trailing blanks s/^ *\/\/.*//; # remove comment lines - s/, *\/\/.*/,/; # strip trailing comments + s/ *\/\/.*//; # strip trailing comments + s/\/\*.*\*\///g; # strip c comments + if (/\/\*/) { + $InComment = 1; + s/\/\*.*$//; # remove start of comment + } + elsif (/\*\//) { + $InComment = 0; + s/^.*\*\///; # remove end of comment + } + elsif ($InComment) { + next; + } next if (/^ *$/); # skip empty lines + next if (/#if/); + next if (/#endif/); next unless ($found or $found = /const *tI18nPhrase .*{/); # sync on phrases next if (/const *tI18nPhrase .*{/); # skip sync line last if (/{ *NULL *}/); # stop after last phrase @@ -324,7 +339,7 @@ while (<OLD>) { $_ .= " i18n"; } elsif (/^clean:/) { - $_ .= "\n\t\@-rm -f \$(PODIR)/*.mo \$(PODIR)/*.pot"; + $_ .= "\n\t\@-rm -f \$(PODIR)/*.mo \$(PODIR)/*.pot"; } print NEW "$_\n"; } |