Skip to content

Commit

Permalink
remove 18n not required for core plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Dec 19, 2014
1 parent 78ff27f commit e4a8fd8
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions python/plugins/MetaSearch/plugin.py
Expand Up @@ -24,7 +24,6 @@
###############################################################################

import logging
import os

from PyQt4.QtCore import QCoreApplication, QLocale, QSettings, QTranslator
from PyQt4.QtGui import QAction, QIcon
Expand All @@ -47,31 +46,6 @@ def __init__(self, iface):
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"""

Expand Down

0 comments on commit e4a8fd8

Please sign in to comment.