summaryrefslogtreecommitdiff
path: root/po
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2010-04-26 22:00:21 -0700
committerDaniel Burrows <dburrows@debian.org>2010-04-26 22:00:21 -0700
commiteb44c6e9eba49990460c4c0f69a8fb4e5da3e3d3 (patch)
tree3ae9da6d7c1908976357eea9c08ebb8749051703 /po
parent50c087c2474f12c23a72b25f3ef8c31a3bcde1e4 (diff)
downloadaptitude-eb44c6e9eba49990460c4c0f69a8fb4e5da3e3d3.tar.gz
Add an SConscript file for the po/ directory.
Diffstat (limited to 'po')
-rw-r--r--po/SConscript87
1 files changed, 87 insertions, 0 deletions
diff --git a/po/SConscript b/po/SConscript
new file mode 100644
index 00000000..51702b76
--- /dev/null
+++ b/po/SConscript
@@ -0,0 +1,87 @@
+# Copyright (C) 2010 Daniel Burrows
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA.
+
+Import('all_aptitude_srcs', 'po_env')
+
+pofile_languages = [
+ 'ar',
+ 'ast',
+ 'bs',
+ 'ca',
+ 'cs',
+ 'da',
+ 'de',
+ 'dz',
+ 'el',
+ 'es',
+ 'eu',
+ 'fi',
+ 'fr',
+ 'gl',
+ 'hu',
+ 'it',
+ 'ja',
+ 'km',
+ 'ku',
+ 'lt',
+ 'mr',
+ 'nb',
+ 'ne',
+ 'nl',
+ 'nn',
+ 'pl',
+ 'pt',
+ 'pt_BR',
+ 'ro',
+ 'ru',
+ 'sk',
+ 'sv',
+ 'th',
+ 'tl',
+ 'tr',
+ 'uk',
+ 'vi',
+ 'zh_CN',
+ 'zh_TW',
+ ]
+
+def BuildPoFile(env, lang, potfile = 'aptitude.pot'):
+ '''Build the po file for the given language, compile it to a mo
+file, and install the compiled form. Also distribute *both* the po
+file and the mo file.'''
+ po_file = env.Msgmerge(lang, potfile)
+ # TODO: the Precious() call should be in the pofile builder, if
+ # that's even possible?
+ env.Precious(po_file)
+ mo_file = env.Msgfmt(po_file)
+ po_env.Dist(po_file, mo_file)
+ env.Install('$LOCALEDIR/$LANG/LC_MESSAGES', LANG = lang)
+ env.Alias('update-po', mo_file)
+ return mo_file
+
+aptitude_pot = po_env.Xgettext('aptitude.pot', all_aptitude_srcs)
+po_env.Dist(aptitude_pot)
+
+# I seriously considered making aptitude.pot a default target, but
+# that would pollute the version control history with a bunch of
+# relatively meaningless changes. Better to only build it on request.
+po_env.Alias('update-po', aptitude_pot)
+
+
+# Rules relating to keeping the translations up-to-date.
+for lang in pofile_languages:
+ BuildPoFile(po_env, lang, aptitude_pot)