diff --git a/ChangeLog b/ChangeLog index 0b09899d..4b479fd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ src/plugindata.h: Add new signal: "geany-startup-complete" which is sent once all initialization and startup tasks has been done. + * README.I18N, configure.ac, wscript, po/LINGUAS: + Remove po/LINGUAS from the repository. + Generate it automatically if needed by reading available + message catalogs from the po directory. + Also respect the LINGUAS environment variable properly. 2010-01-16 Frank Lanitz diff --git a/README.I18N b/README.I18N index bf273dc5..54f81c04 100644 --- a/README.I18N +++ b/README.I18N @@ -20,8 +20,8 @@ text editor (like Geany ;-)) or you can also use a graphical interface. I can suggest PoEdit (http://www.poedit.net/), but there are several other GUIs. -Make sure you add your language to the file po/LINGUAS. -Just open the file with a text editor and add your code. +You don't need to modify the file po/LINGUAS, it is regenerated +automatically on the next build. When you have finished editing the file, check the file with: diff --git a/configure.ac b/configure.ac index a41347fc..14b6601b 100644 --- a/configure.ac +++ b/configure.ac @@ -240,7 +240,16 @@ GETTEXT_PACKAGE=geany AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) -ALL_LINGUAS="`sed -e '/^#/d' $srcdir/po/LINGUAS`" # take all languages found in file po/LINGUAS +if test -n "${LINGUAS}" +then + ALL_LINGUAS="${LINGUAS}" + echo "special" +else + if test -z "$conf_dir" ; then + conf_dir="." + fi + ALL_LINGUAS=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | $AWK 'BEGIN { FS="."; ORS=" " } { print $1 }'` +fi AM_GLIB_GNU_GETTEXT # workaround for intltool bug (http://bugzilla.gnome.org/show_bug.cgi?id=490845) diff --git a/po/LINGUAS b/po/LINGUAS deleted file mode 100644 index 692b1411..00000000 --- a/po/LINGUAS +++ /dev/null @@ -1,2 +0,0 @@ -# set of available languages (in alphabetic order) -be bg ca cs de el en_GB es fi fr gl hu it ja ko lb nl pl pt pt_BR ro ru sl sv tr uk vi zh_CN zh_TW diff --git a/wscript b/wscript index 610833f3..3d0e125b 100644 --- a/wscript +++ b/wscript @@ -51,6 +51,7 @@ import os import shutil import tempfile from distutils import version +from TaskGen import taskgen, feature APPNAME = 'geany' @@ -195,6 +196,8 @@ def configure(conf): # we don't require intltool on Windows (it would require Perl) though it works well try: conf.check_tool('intltool') + if 'LINGUAS' in os.environ: + conf.env['LINGUAS'] = os.environ['LINGUAS'] except: pass @@ -513,6 +516,23 @@ def build(bld): bld.install_files('${DATADIR}/icons/hicolor/scalable/apps', 'icons/scalable/*.svg') +@taskgen +@feature('intltool_po') +def write_linguas_file(self): + linguas = '' + if 'LINGUAS' in Build.bld.env: + linguas = Build.bld.env['LINGUAS'] + else: + files = os.listdir('%s/po' % self.path.abspath()) + files.sort() + for f in files: + if f.endswith('.po'): + linguas += '%s ' % f[:-3] + f = open("po/LINGUAS", "w") + f.write('# This file is autogenerated. Do not edit.\n%s\n' % linguas) + f.close() + + def shutdown(): is_win32 = False if not Build.bld else target_is_win32(Build.bld.env) # the following code was taken from midori's WAF script, thanks