I have interaction with layer defined by custom designed UIs. In layer properties the following settings: Edit UI - customline.ui and Python Init function: customline_set.py.
#coding: utf8
from PyQt4.QtCore import *
from PyQt4.QtGui import *
nameField = None
myDialog = None
def formOpen(dialog,layerid,featureid):
global myDialog
myDialog = dialog
global nameField
translator = QTranslator()
loc = QSettings().value('locale/userLocale')[0:2]
print loc
filename = "\\i18n\\customline_%s.qm" % loc
print filename
translator.load(filename)
QCoreApplication.installTranslator(translator)
print QCoreApplication.translate('editForm',"Generals")
# return translated string ok
The code work without error but the UI it's not displayed in selected language.
Can anyone point me in the direction of the mistake here?