Permalink
Browse files

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.


git-svn-id: https://geany-plugins.svn.sourceforge.net/svnroot/geany-plugins/trunk/geany-plugins@1138 e8383189-8249-0410-b506-acc975200cbd
  • Loading branch information...
1 parent f7f0942 commit 85db7a3e343f35a9a3f133babb60968682ff14c0 @eht16 eht16 committed Jan 17, 2010
Showing with 30 additions and 3 deletions.
  1. +9 −0 build/i18n.m4
  2. +1 −1 configure.ac
  3. +0 −2 po/LINGUAS
  4. +20 −0 wscript
View
@@ -1,5 +1,14 @@
AC_DEFUN([GP_I18N],
[
+ if test -n "${LINGUAS}"
+ then
+ ALL_LINGUAS="${LINGUAS}"
+ 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
GETTEXT_PACKAGE=geany-plugins
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(
View
@@ -4,7 +4,7 @@ AM_INIT_AUTOMAKE([1.8 foreign dist-bzip2 tar-ustar])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
-AC_CONFIG_SRCDIR([po/LINGUAS])
+AC_CONFIG_SRCDIR([po/POTFILES.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([build/cache])
View
@@ -1,2 +0,0 @@
-# set of available languages (in alphabetic order)
-be ca da de es fr ja pt_BR pt ru tr zh_CN
View
20 wscript
@@ -48,6 +48,7 @@ import Build
import Options
import Utils
import preproc
+from TaskGen import taskgen, feature
APPNAME = 'geany-plugins'
@@ -196,6 +197,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
@@ -355,6 +358,23 @@ def set_options(opt):
{ '1' : plugins[0].name, '2' : plugins[1].name }, dest='skip_plugins')
+@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 build(bld):
is_win32 = target_is_win32(bld.env)

0 comments on commit 85db7a3

Please sign in to comment.