Esempio n. 1
0
    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
Esempio n. 2
0
    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