def Xtest_setupI18n(self): """Gui translations are working.""" myUntranslatedString = 'Show/hide InaSAFE dock widget' myExpectedString = 'Tampilkan/hilangkan widget InaSAFE' myParent = QWidget() myCanvas = QgsMapCanvas(myParent) myIface = QgisInterface(myCanvas) myPlugin = Plugin(myIface) myPlugin.setup_i18n('id') myTranslation = myPlugin.tr(myUntranslatedString) myMessage = '\nTranslated: %s\nGot: %s\nExpected: %s' % \ (myUntranslatedString, myTranslation, myExpectedString) assert myTranslation == myExpectedString, myMessage
def test_setupI18n(self): """Gui translations are working.""" myUntranslatedString = 'Show/hide InaSAFE dock widget' myExpectedString = 'Tampilkan/hilangkan widget InaSAFE' myParent = QWidget() myCanvas = QgsMapCanvas(myParent) myIface = QgisInterface(myCanvas) myPlugin = Plugin(myIface) myPlugin.setupI18n('id') myTranslation = myPlugin.tr(myUntranslatedString) myMessage = '\nTranslated: %s\nGot: %s\nExpected: %s' % ( myUntranslatedString, myTranslation, myExpectedString) assert myTranslation == myExpectedString, myMessage