From 3de03c51ef193d57526b2f00be02293c7e1ace27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Mon, 12 Mar 2012 16:43:12 +0000 Subject: [PATCH] 5621: cleanup, add an experimental script for merging translations svn: r19050 --- po/update_po.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 10 ++-------- 2 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 po/update_po.py diff --git a/po/update_po.py b/po/update_po.py new file mode 100644 index 000000000..f8166b65f --- /dev/null +++ b/po/update_po.py @@ -0,0 +1,51 @@ +#! /usr/bin/env python +# +# update_po - a gramps tool to update a po file +# +# Copyright (C) 2006-2006 Kees Bakker +# Copyright (C) 2012 +# +# 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; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +import os +import sys +from optparse import OptionParser + + + +def main(): + + parser = OptionParser( + description='This program updates the PO file(s) for Gramps,' + ' by generating a new file for tanslator: "update.po".', + usage='%prog [options] lang.po' + ) + + parser.add_option("-a", "--all", + action="store_true", dest="all", default=False, + help="update all translations (not active)") + + (options, args) = parser.parse_args() + + if options.all: + print('Not implemented yet') + + for po in args: + os.system('''msgmerge --no-wrap %s gramps.pot -o update.po''' % po) + + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py index 374c2a5e4..b6e306083 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ if sys.version < '2.6': if os.name == 'nt': script = [os.path.join('windows','gramps.pyw')] elif os.name == 'darwin': - script = [os.path.join('mac','launcher.sh')] + script = [os.path.join('mac','gramps.launcher.sh')] else: # os.name == 'posix' script = [os.path.join('gramps.sh')] @@ -520,12 +520,6 @@ class Uninstall(Command): print ("skipping empty directory %s" % repr(dir)) -# TODO -# implement environment/variables for -# extract_messages, update_catalog classes -# message_extractors = po/POTFILES.in -# see also 'setup.cfg' - result = setup( name = name, version = version, @@ -555,5 +549,5 @@ result = setup( 'install': InstallData, # override Install! #'install_data': InstallData, 'uninstall': Uninstall, - 'extract_messages': ExtractMessages,} + 'extract_messages': ExtractMessages} )