diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 7b5d86d54..824199469 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -124,6 +124,7 @@ class OpenLPToolbar(QtGui.QToolBar): log.error(u'getIconFromTitle - no icon for %s' % title) return QtGui.QIcon() except: + log.exception(u'getIconFromTitle - title %s not found' % title) return QtGui.QIcon() def makeWidgetsInvisible(self, widgets): diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index b3a7ffcbe..8c351b17c 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -167,8 +167,7 @@ class Ui_AboutDialog(object): self.AboutNotebook.indexOf(self.CreditsTab), translate('AboutForm', 'Credits')) self.LicenseTextEdit.setPlainText(translate('AboutForm', - 'Copyright \xa9 2004-2010 Raoul ' - 'Snyman\n' + 'Copyright \xa9 2004-2010 Raoul Snyman\n' 'Portions copyright \xa9 2004-2010 ' 'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' 'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon ' diff --git a/resources/i18n/openlp_en.ts b/resources/i18n/openlp_en.ts index c27f8bd5a..5f84b2125 100644 --- a/resources/i18n/openlp_en.ts +++ b/resources/i18n/openlp_en.ts @@ -202,17 +202,17 @@ This General Public License does not permit incorporating your program into prop - + License - + Contribute - + Close diff --git a/scripts/translation_utils.py b/scripts/translation_utils.py index bfb443d1b..7a76a5566 100755 --- a/scripts/translation_utils.py +++ b/scripts/translation_utils.py @@ -1,172 +1,172 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - -############################################################################### -# OpenLP - Open Source Lyrics Projection # -# --------------------------------------------------------------------------- # -# Copyright (c) 2008-2010 Raoul Snyman # -# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # -# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # -# Thompson, Jon Tibble, Carsten Tinggaard # -# --------------------------------------------------------------------------- # -# 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; version 2 of the License. # -# # -# 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 # -############################################################################### -# Short description -# Steps for creating languages: -# 1. make shure that the openlp_en.ts file exist -# 2. go to scripts folder and start: -# python translation_utils.py -a -############################################################################### - -import os -from optparse import OptionParser -import urllib -from PyQt4 import QtCore - -ignore_pathes = ["./scripts", "./openlp/core/test"] -ignore_files = ["setup.py"] -translation_path = "http://pootle.projecthq.biz/export/openlp/" -translations = [ "af" - , "en_ZA" - , "en_GB" - , "de" - , "hu" - , "ko" - , "nb" - , "pt_BR" - , "es" - , "sv"] - - - -def write_file(filename, stringlist): - content = u'' - for line in stringlist: - content = u'%s%s\n' % (content, line) - file = open(filename, u'w') - file.write(content.encode('utf8')) - file.close() - -def main(): - # Set up command line options. - usage = u'Usage: %prog [options]' - parser = OptionParser(usage=usage) - parser.add_option("-d", "--download-ts", action="store_true", dest="download", - help="Load languages from Pootle Server") - parser.add_option("-p", "--prepare", action="store_true", dest="prepare", - help="preparation (generate pro file)") - parser.add_option("-u", "--update", action="store_true", dest="update", - help="update translation files") - parser.add_option("-g", "--generate", action="store_true", dest="generate", - help="generate qm files") - parser.add_option("-a", "--all", action="store_true", dest="all", - help="proceed all options") - - (options, args) = parser.parse_args() - qt_args = [] - if options.download: - downloadTranslations() - elif options.prepare: - preparation() - elif options.update: - update() - elif options.generate: - generate() - elif options.all: - all() - else: - pass - -def downloadTranslations(): - print "download()" - for language in translations: - filename = os.path.join('..','resources', 'i18n', "openlp_%s.ts" % language) - print filename - page = urllib.urlopen("%s%s.ts" % (translation_path, language)) - content = page.read().decode("utf8") - page.close() - file = open(filename, u'w') - file.write(content.encode('utf8')) - file.close() - -def preparation(): - stringlist = [] - start_dir = os.path.join(u'..') - for root, dirs, files in os.walk(start_dir): - for file in files: - path = "%s" % root - path = path.replace("\\","/") - path = path.replace("..",".") - - if file.startswith(u'hook-') or file.startswith(u'test_'): - continue - - cond = False - for search in ignore_pathes: - if path.startswith(search): - cond = True - if cond == True: - continue - cond = False - for search in ignore_files: - if search == file: - cond = True - if cond == True: - continue - - if file.endswith(u'.py'): - line = "%s/%s" % (path, file) - print u'Parsing "%s"' % line - stringlist.append("SOURCES += %s" % line) - elif file.endswith(u'.pyw'): - line = "%s/%s" % (path, file) - print u'Parsing "%s"' % line - stringlist.append("SOURCES += %s" % line) - elif file.endswith(u'.ts'): - line = "%s/%s" % (path, file) - print u'Parsing "%s"' % line - stringlist.append("TRANSLATIONS += %s" % line) - - print u'Generating PRO file...', - stringlist.sort() - write_file(os.path.join(start_dir, u'openlp.pro'), stringlist) - print u'done.' - - -def update(): - print "update()" - updateProcess = QtCore.QProcess() - updateProcess.start("pylupdate4 -noobsolete ../openlp.pro") - updateProcess.waitForFinished(60000) - -def generate(): - print "generate()" - generateProcess = QtCore.QProcess() - generateProcess.start("lrelease ../openlp.pro") - generateProcess.waitForFinished(60000) - -def all(): - print "all()" - downloadTranslations() - preparation() - update() - generate() - - -if __name__ == u'__main__': - if os.path.split(os.path.abspath(u'.'))[1] != u'scripts': - print u'You need to run this script from the scripts directory.' - else: - main() +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2010 Raoul Snyman # +# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael # +# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin # +# Thompson, Jon Tibble, Carsten Tinggaard # +# --------------------------------------------------------------------------- # +# 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; version 2 of the License. # +# # +# 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 # +############################################################################### +# Short description +# Steps for creating languages: +# 1. make shure that the openlp_en.ts file exist +# 2. go to scripts folder and start: +# python translation_utils.py -a +############################################################################### + +import os +from optparse import OptionParser +import urllib +from PyQt4 import QtCore + +ignore_pathes = [u"./scripts", u"./openlp/core/test"] +ignore_files = [u"setup.py"] +translation_path = u"http://pootle.projecthq.biz/export/openlp/" +translations = [ u"af" + , u"en_ZA" + , u"en_GB" + , u"de" + , u"hu" + , u"ko" + , u"nb" + , u"pt_BR" + , u"es" + , u"sv"] + + + +def write_file(filename, stringlist): + content = u'' + for line in stringlist: + content = u'%s%s\n' % (content, line) + file = open(filename, u'w') + file.write(content.encode('utf8')) + file.close() + +def main(): + # Set up command line options. + usage = u'Usage: %prog [options]' + parser = OptionParser(usage=usage) + parser.add_option("-d", "--download-ts", action="store_true", dest="download", + help="Load languages from Pootle Server") + parser.add_option("-p", "--prepare", action="store_true", dest="prepare", + help="preparation (generate pro file)") + parser.add_option("-u", "--update", action="store_true", dest="update", + help="update translation files") + parser.add_option("-g", "--generate", action="store_true", dest="generate", + help="generate qm files") + parser.add_option("-a", "--all", action="store_true", dest="all", + help="proceed all options") + + (options, args) = parser.parse_args() + qt_args = [] + if options.download: + downloadTranslations() + elif options.prepare: + preparation() + elif options.update: + update() + elif options.generate: + generate() + elif options.all: + all() + else: + pass + +def downloadTranslations(): + print "download()" + for language in translations: + filename = os.path.join(u'..',u'resources', u'i18n', u"openlp_%s.ts" % language) + print filename + page = urllib.urlopen(u"%s%s.ts" % (translation_path, language)) + content = page.read().decode("utf8") + page.close() + file = open(filename, u'w') + file.write(content.encode('utf8')) + file.close() + +def preparation(): + stringlist = [] + start_dir = os.path.join(u'..') + for root, dirs, files in os.walk(start_dir): + for file in files: + path = u"%s" % root + path = path.replace("\\","/") + path = path.replace("..",".") + + if file.startswith(u'hook-') or file.startswith(u'test_'): + continue + + cond = False + for search in ignore_pathes: + if path.startswith(search): + cond = True + if cond == True: + continue + cond = False + for search in ignore_files: + if search == file: + cond = True + if cond == True: + continue + + if file.endswith(u'.py'): + line = u"%s/%s" % (path, file) + print u'Parsing "%s"' % line + stringlist.append(u"SOURCES += %s" % line) + elif file.endswith(u'.pyw'): + line = u"%s/%s" % (path, file) + print u'Parsing "%s"' % line + stringlist.append(u"SOURCES += %s" % line) + elif file.endswith(u'.ts'): + line = u"%s/%s" % (path, file) + print u'Parsing "%s"' % line + stringlist.append(u"TRANSLATIONS += %s" % line) + + print u'Generating PRO file...', + stringlist.sort() + write_file(os.path.join(start_dir, u'openlp.pro'), stringlist) + print u'done.' + + +def update(): + print "update()" + updateProcess = QtCore.QProcess() + updateProcess.start(u"pylupdate4 -noobsolete ../openlp.pro") + updateProcess.waitForFinished(60000) + +def generate(): + print "generate()" + generateProcess = QtCore.QProcess() + generateProcess.start(u"lrelease ../openlp.pro") + generateProcess.waitForFinished(60000) + +def all(): + print "all()" + downloadTranslations() + preparation() + update() + generate() + + +if __name__ == u'__main__': + if os.path.split(os.path.abspath(u'.'))[1] != u'scripts': + print u'You need to run this script from the scripts directory.' + else: + main()