Fix and update translation template handling

This commit is contained in:
Christian Dywan 2008-06-02 01:54:38 +02:00
parent a97264a090
commit c7626bfda2
3 changed files with 38 additions and 11 deletions

View File

@ -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

View File

@ -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'

View File

@ -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)