# HG changeset patch # User Adrien Di Mascio # Date 1226572345 -3600 # Node ID c7c22b2103729f70ae37ece498aa9c5a385ff6c2 # Parent 3ab9528454484ca0d7fa1439f04efee4273bb44e only try to internationalize our own js files diff -r 3ab952845448 -r c7c22b210372 devtools/devctl.py --- a/devtools/devctl.py Thu Nov 13 11:27:22 2008 +0100 +++ b/devtools/devctl.py Thu Nov 13 11:32:25 2008 +0100 @@ -212,7 +212,7 @@ from tempfile import mktemp import yams from logilab.common.fileutils import ensure_fs_mode - from logilab.common.shellutils import find, rm + from logilab.common.shellutils import globfind, find, rm from cubicweb.common.i18n import extract_from_tal, execute tempdir = mktemp() mkdir(tempdir) @@ -229,13 +229,13 @@ tali18nfile = join(tempdir, 'tali18n.py') extract_from_tal(find(join(BASEDIR, 'web'), ('.py', '.pt')), tali18nfile) print '******** .pot files generation' - for id, files, lang in [('cubicweb', get_module_files(BASEDIR) + find(join(BASEDIR, 'misc', 'migration'), '.py'), None), - ('schemadescr', find(join(BASEDIR, 'schemas'), '.py'), None), + for id, files, lang in [('cubicweb', get_module_files(BASEDIR) + list(globfind(join(BASEDIR, 'misc', 'migration'), '*.py')), None), + ('schemadescr', globfind(join(BASEDIR, 'schemas'), '*.py'), None), ('yams', get_module_files(yams.__path__[0]), None), ('tal', [tali18nfile], None), - ('js', find(join(BASEDIR, 'web'), '.js'), 'java'), + ('js', globfind(join(BASEDIR, 'web'), 'cub*.js'), 'java'), ]: - cmd = 'xgettext --no-location --omit-header -k_ -o %s %s' + cmd = 'xgettext --add-location --omit-header -k_ -o %s %s' if lang is not None: cmd += ' -L %s' % lang potfiles.append(join(tempdir, '%s.pot' % id)) @@ -253,7 +253,7 @@ shutil.move('%snew' % target, target) toedit.append(abspath(target)) # cleanup - rm(tempdir) + # rm(tempdir) # instructions pour la suite print '*' * 72 print 'you can now edit the following files:' @@ -310,7 +310,7 @@ tali18nfile = join(tempdir, 'tali18n.py') extract_from_tal(find('.', ('.py', '.pt'), blacklist=STD_BLACKLIST+('test',)), tali18nfile) print '******** extract Javascript messages' - jsfiles = find('.', '.js') + jsfiles = [jsfile for jsfile in find('.', '.js') if basename(jsfile).startswith('cub')] if jsfiles: tmppotfile = join(tempdir, 'js.pot') execute('xgettext --no-location --omit-header -k_ -L java --from-code=utf-8 -o %s %s'