remove 18n not required for core plugins

This commit is contained in:
Tom Kralidis 2014-12-19 07:57:22 -05:00
parent 78ff27f92e
commit e4a8fd8c78

View File

@ -24,7 +24,6 @@
###############################################################################
import logging
import os
from PyQt4.QtCore import QCoreApplication, QLocale, QSettings, QTranslator
from PyQt4.QtGui import QAction, QIcon
@ -47,31 +46,6 @@ class MetaSearchPlugin(object):
self.dialog = None
self.web_menu = '&MetaSearch'
LOGGER.debug('Setting up i18n')
# TODO: does this work for locales like: pt_BR ?
locale_name = QSettings().value("locale/userLocale")[0:2]
# this one below does not pick up when you load QGIS with --lang param
# locale_name = str(QLocale.system().name()).split('_')[0]
LOGGER.debug('Locale name: %s', locale_name)
# load if exists
tr_file = os.path.join(self.context.ppath, 'locale', locale_name,
'LC_MESSAGES', 'ui.qm')
if os.path.exists(tr_file):
self.translator = QTranslator()
result = self.translator.load(tr_file)
if not result:
msg = 'Failed to load translation: %s' % tr_file
LOGGER.error(msg)
raise RuntimeError(msg)
QCoreApplication.installTranslator(self.translator)
LOGGER.debug(QCoreApplication.translate('MetaSearch',
'Translation loaded: %s' % tr_file))
def initGui(self):
"""startup"""