Skip to content
Permalink
Browse files

remove 18n not required for core plugins

  • Loading branch information
tomkralidis committed Dec 19, 2014
1 parent 78ff27f commit e4a8fd8c78b4ff268317615ec0d76ab1e099e70c
Showing with 0 additions and 26 deletions.
  1. +0 −26 python/plugins/MetaSearch/plugin.py
@@ -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 @@ 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"""

0 comments on commit e4a8fd8

Please sign in to comment.
You can’t perform that action at this time.