24
24
###############################################################################
25
25
26
26
import logging
27
- import os
28
27
29
28
from PyQt4 .QtCore import QCoreApplication , QLocale , QSettings , QTranslator
30
29
from PyQt4 .QtGui import QAction , QIcon
@@ -47,31 +46,6 @@ def __init__(self, iface):
47
46
self .dialog = None
48
47
self .web_menu = '&MetaSearch'
49
48
50
- LOGGER .debug ('Setting up i18n' )
51
-
52
- # TODO: does this work for locales like: pt_BR ?
53
- locale_name = QSettings ().value ("locale/userLocale" )[0 :2 ]
54
- # this one below does not pick up when you load QGIS with --lang param
55
- # locale_name = str(QLocale.system().name()).split('_')[0]
56
-
57
- LOGGER .debug ('Locale name: %s' , locale_name )
58
-
59
- # load if exists
60
- tr_file = os .path .join (self .context .ppath , 'locale' , locale_name ,
61
- 'LC_MESSAGES' , 'ui.qm' )
62
-
63
- if os .path .exists (tr_file ):
64
- self .translator = QTranslator ()
65
- result = self .translator .load (tr_file )
66
- if not result :
67
- msg = 'Failed to load translation: %s' % tr_file
68
- LOGGER .error (msg )
69
- raise RuntimeError (msg )
70
- QCoreApplication .installTranslator (self .translator )
71
-
72
- LOGGER .debug (QCoreApplication .translate ('MetaSearch' ,
73
- 'Translation loaded: %s' % tr_file ))
74
-
75
49
def initGui (self ):
76
50
"""startup"""
77
51
0 commit comments