mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-28 00:05:04 -04:00
remove 18n not required for core plugins
This commit is contained in:
parent
78ff27f92e
commit
e4a8fd8c78
@ -24,7 +24,6 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
|
|
||||||
from PyQt4.QtCore import QCoreApplication, QLocale, QSettings, QTranslator
|
from PyQt4.QtCore import QCoreApplication, QLocale, QSettings, QTranslator
|
||||||
from PyQt4.QtGui import QAction, QIcon
|
from PyQt4.QtGui import QAction, QIcon
|
||||||
@ -47,31 +46,6 @@ class MetaSearchPlugin(object):
|
|||||||
self.dialog = None
|
self.dialog = None
|
||||||
self.web_menu = '&MetaSearch'
|
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):
|
def initGui(self):
|
||||||
"""startup"""
|
"""startup"""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user