Fix translation files

bzr-revno: 1049
This commit is contained in:
rimach 2010-09-22 05:45:27 +01:00 committed by Tim Bentley
commit ee33309838
14 changed files with 5566 additions and 8394 deletions

View File

@ -107,7 +107,10 @@ class LanguageManager(object):
``action`` ``action``
The language menu option The language menu option
""" """
action_name = u'%s' % action.objectName() if action is None:
action_name = u'en'
else:
action_name = u'%s' % action.objectName()
qm_list = LanguageManager.get_qm_list() qm_list = LanguageManager.get_qm_list()
if LanguageManager.auto_language: if LanguageManager.auto_language:
language = u'[%s]' % qm_list[action_name] language = u'[%s]' % qm_list[action_name]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -52,6 +52,7 @@ This is done easily via the ``-d``, ``-p`` and ``-u`` options::
import os import os
import urllib import urllib
import re import re
from shutil import copy
from optparse import OptionParser from optparse import OptionParser
from PyQt4 import QtCore from PyQt4 import QtCore
@ -227,6 +228,7 @@ def update_translations():
else: else:
os.chdir(os.path.abspath(u'..')) os.chdir(os.path.abspath(u'..'))
run(u'pylupdate4 -verbose -noobsolete openlp.pro') run(u'pylupdate4 -verbose -noobsolete openlp.pro')
os.chdir(os.path.abspath(u'scripts'))
def generate_binaries(): def generate_binaries():
print u'Generate the related *.qm files' print u'Generate the related *.qm files'
@ -239,6 +241,17 @@ def generate_binaries():
else: else:
os.chdir(os.path.abspath(u'..')) os.chdir(os.path.abspath(u'..'))
run(u'lrelease openlp.pro') run(u'lrelease openlp.pro')
os.chdir(os.path.abspath(u'scripts'))
src_path = os.path.join(os.path.abspath(u'..'), u'resources', u'i18n')
dest_path = os.path.join(os.path.abspath(u'..'), u'openlp', u'i18n')
if not os.path.exists(dest_path):
os.makedirs(dest_path)
src_list = os.listdir(src_path)
for file in src_list:
if re.search('.qm$', file):
copy(os.path.join(src_path, u'%s' % file),
os.path.join(dest_path, u'%s' % file))
def create_translation(language): def create_translation(language):
""" """
@ -330,4 +343,3 @@ if __name__ == u'__main__':
print u'You need to run this script from the scripts directory.' print u'You need to run this script from the scripts directory.'
else: else:
main() main()