From c7626bfda247cb5c1aee30e79f52ba903731bc93 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 2 Jun 2008 01:54:38 +0200 Subject: [PATCH] Fix and update translation template handling --- po/POTFILES.in | 22 +++++++++++----------- po/wscript_build | 26 ++++++++++++++++++++++++++ wscript | 1 + 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 4a6722c2..2cdc211f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,17 +1,17 @@ # List of source files containing translatable strings. midori.desktop.in -src/main.c -src/midori-console.c -src/midori-browser.c -src/midori-panel.c -src/midori-trash.c -src/midori-websettings.c -src/midori-webview.c -src/midori-preferences.c -src/search.c -src/sokoke.c -src/webSearch.c +midori/main.c +midori/midori-console.c +midori/midori-browser.c +midori/midori-panel.c +midori/midori-trash.c +midori/midori-websettings.c +midori/midori-webview.c +midori/midori-preferences.c +midori/search.c +midori/sokoke.c +midori/webSearch.c katze/katze-throbber.c katze/katze-utils.c katze/katze-xbel.c diff --git a/po/wscript_build b/po/wscript_build index 3a1dce71..149046b6 100644 --- a/po/wscript_build +++ b/po/wscript_build @@ -1,5 +1,31 @@ #! /usr/bin/env python # WAF build script for midori +import Params +import pproc as subprocess +import os + +if bld.env ()['INTLTOOL_UPDATE']: + os.chdir ('./po') + try: + try: + size_old = os.stat ('midori.pot').st_size + except: + size_old = 0 + subprocess.call (['intltool-update', '--pot']) + size_new = os.stat ('midori.pot').st_size + if size_new <> size_old: + Params.pprint ('YELLOW', "Updated po template.") + try: + intltool_update = subprocess.Popen (['intltool-update', '-r'], + stderr=subprocess.PIPE) + intltool_update.wait () + Params.pprint ('YELLOW', "Updated translations.") + except: + Params.pprint ('RED', "Failed to update translations.") + except: + Params.pprint ('RED', "Failed to generate po template.") + os.chdir ('..') + obj = bld.create_obj ('intltool_po') obj.appname = 'midori' diff --git a/wscript b/wscript index 862d587f..0a364190 100644 --- a/wscript +++ b/wscript @@ -24,6 +24,7 @@ def configure (conf): if not Params.g_options.disable_nls: conf.check_tool ('intltool') if conf.env['INTLTOOL'] and conf.env['POCOM']: + conf.find_program ('intltool-update', var='INTLTOOL_UPDATE') nls = 'yes' conf.define ('ENABLE_NLS', 1) conf.define ('MIDORI_LOCALEDIR', 'LOCALEDIR', 0)