• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python commons.i18n函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pygobstones.commons.i18n函数的典型用法代码示例。如果您正苦于以下问题:Python i18n函数的具体用法?Python i18n怎么用?Python i18n使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了i18n函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: openSelectBoardSizeWindow

    def openSelectBoardSizeWindow(self, function, title):

        self.widgetSize = QtGui.QDialog(self)
        self.widgetSize.setWindowTitle(i18n(title))
        self.widgetSize.setGeometry(500, 300, 180, 180)
        self.widgetSize.setMaximumSize(280, 200)
        self.setStyleSheet("background-color:'white'")

        widthL = QtGui.QLabel(self.widgetSize)
        widthL.setText(i18n('input') + ' x')
        widthL.move(20, 20)
        self.widthLE = QtGui.QLineEdit(self.widgetSize)
        self.widthLE.setGeometry(20, 45, 80, 30)
        
        heightL = QtGui.QLabel(self.widgetSize)
        heightL.setText(i18n('input')+ ' y')
        heightL.move(20, 70)
        self.heightLE = QtGui.QLineEdit(self.widgetSize)
        self.heightLE.setGeometry(20, 95, 80, 30)

        hLayout = QtGui.QHBoxLayout()
        hLayout.addStretch(1)
        acceptButton = QtGui.QPushButton(i18n('Accept'))
        acceptButton.clicked.connect(function)
        hLayout.addWidget(acceptButton)

        vLayout = QtGui.QVBoxLayout()
        vLayout.addStretch(1)
        vLayout.addLayout(hLayout)

        self.widgetSize.setLayout(vLayout)

        self.widgetSize.exec_()
开发者ID:gobstones,项目名称:pygobstones,代码行数:33,代码来源:boardOption.py


示例2: success

 def success(self, board_string, result):
     if not self.interactiveRunning:
         if not self.wasStoped:
             self.mainW.ui.statusbar.showMessage(QtCore.QString
             (i18n('Execution completed')))
             self.results = Results(self.mainW)
             board = self.prepareString(board_string)
             self.results.setInitialBoard(BoardViewer(self,
             self.mainW.initialBoardGenerator.board, self.mainW.getClothing()))
             self.results.setFinalBoard(BoardViewer(self,
             parseABoardString(board), self.mainW.getClothing()))
             self.results.setRetVars(result)
             self.setCodeInResults()
             self.results.ui.tabWidgetResults.setCurrentIndex(2)
             self.results.show()
             self.mainW.resetButtonsRunAndStop()
             self.showInLog(i18n('Execution completed'))
             self.log('----------------'+
             unicode(datetime.datetime.now())[:19] +
             '-----------------\n')
     else:
         self.mainW.ui.statusbar.showMessage(QtCore.QString
             (i18n('Execution completed')))
         self.showInLog(i18n('Execution completed'))
         self.log('----------------'+
             unicode(datetime.datetime.now())[:19] +
             '-----------------\n')
         self.interactiveW.setStatusMessage('    ' + i18n('Execution completed'))
         self.mainW.resetButtonsRunAndStop()
         self.wasStoped = False
         self.isOpenInteractiveW = False
         self.interactiveRunning = False
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:32,代码来源:mainWindow.py


示例3: checkWasChangesInFiles

 def checkWasChangesInFiles(self):
     if self.mainW.ui.textEditFile.document().isModified():
         val = QMessageBox.question(
             self.mainW,
             i18n("Save changes?"),
             i18n("The file %s was changed, Do you save changes?") % (self.mainW.ui.tabWidgetEditors.tabText(0)[3:]),
             QMessageBox.Yes,
             QMessageBox.No,
             QMessageBox.Cancel,
         )
         if val == QMessageBox.Yes:
             if not self.saveFile():
                 return QMessageBox.Cancel
     if self.mainW.ui.textEditLibrary.document().isModified():
         val = QMessageBox.question(
             self.mainW,
             i18n("Save changes?"),
             i18n("The file %s was changed, Do you save changes?") % (self.mainW.ui.tabWidgetEditors.tabText(1)[3:]),
             QMessageBox.Yes,
             QMessageBox.No,
             QMessageBox.Cancel,
         )
         if val == QMessageBox.Yes:
             if not self.saveFile():
                 return QMessageBox.Cancel
     return val
开发者ID:gobstones,项目名称:pygobstones,代码行数:26,代码来源:fileOption.py


示例4: interpreter_log_default_exception

 def interpreter_log_default_exception(self, exception):
     if not self.wasStoped:
         self.mainW.ui.statusbar.showMessage(QtCore.QString
             (i18n('Was occurred an error')))
         self.showInLog(i18n('Was occurred an error'))
         self.log(exception.msg)
         self.mainW.resetButtonsRunAndStop()
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:7,代码来源:mainWindow.py


示例5: fail_handler

 def fail_handler(exception):
     self.mainW.ui.statusbar.showMessage(QtCore.QString(i18n('Check failed')))
     self.showInLog(i18n('Check failed:'))
     self.showRowAndColError(exception)
     self.log(exception.msg)
     self.log('----------------' +
              unicode(datetime.datetime.now())[:19] +
              '-----------------\n')
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:8,代码来源:mainWindow.py


示例6: stop

 def stop(self):
     self.guiInterpreterHandler.initialStatus()
     self.runButton.stopInterpreter()
     self.resetButtonsRunAndStop()
     self.ui.statusbar.showMessage(QtCore.QString
         (i18n('Execution interrupted by the user')))
     self.guiInterpreterHandler.showInLog(i18n(
                             'Execution interrupted by the user'))
     self.guiInterpreterHandler.log('----------------' +
            unicode(datetime.datetime.now())[:19] +
           '-----------------')
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:11,代码来源:mainWindow.py


示例7: check

 def check(self):
     self.ui.actionStop.setEnabled(True)
     self.ui.actionCheck.setEnabled(False)
     self.ui.actionRun.setEnabled(False)
     self.guiInterpreterHandler.showInLog(i18n(
                     'Start check || Languaje: ') + self.lang)
     self.guiInterpreterHandler.log('----------------' +
            unicode(datetime.datetime.now())[:19] +
           '-----------------')
     self.ui.statusbar.showMessage(QtCore.QString(i18n('Checking...')))
     self.checkButton = CheckButton(self)
     self.checkButton.start()
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:12,代码来源:mainWindow.py


示例8: retranslateUi

    def retranslateUi(self, results):
        results.setWindowTitle(QtGui.QApplication.translate("results", i18n('Mode Results'), None, QtGui.QApplication.UnicodeUTF8))
        self.pushButtonSaveResults.setToolTip(QtGui.QApplication.translate("results", i18n('Save in file the final board'), None, QtGui.QApplication.UnicodeUTF8))
        self.pushButtonSaveResults.setText(QtGui.QApplication.translate("results", i18n('Save Final Board'), None, QtGui.QApplication.UnicodeUTF8))
        self.pushButtonSwitchViews.setToolTip(QtGui.QApplication.translate("switchViews", i18n('Switch between Gobstones Standard view and selected custom view'), None, QtGui.QApplication.UnicodeUTF8))
        self.pushButtonSwitchViews.setText(QtGui.QApplication.translate("switchViews", i18n('Switch Views'), None, QtGui.QApplication.UnicodeUTF8))
        #self.tabWidgetResults.setTabText(self.tabWidgetResults.indexOf(self.tabInitialBoard), QtGui.QApplication.translate("results", i18n('Initial Board'), None, QtGui.QApplication.UnicodeUTF8))
        #self.tabWidgetResults.setTabText(self.tabWidgetResults.indexOf(self.tabFinalBoard), QtGui.QApplication.translate("results", i18n('Final Board'), None, QtGui.QApplication.UnicodeUTF8))

        self.tabWidgetResults.setTabText(self.tabWidgetResults.indexOf(self.splitter), QtGui.QApplication.translate("results", i18n('Source Code'), None, QtGui.QApplication.UnicodeUTF8))

        self.labelResults.setText(QtGui.QApplication.translate("results", i18n('Results'), None, QtGui.QApplication.UnicodeUTF8))
        self.labelViews.setText(QtGui.QApplication.translate("results", i18n('Select View'), None, QtGui.QApplication.UnicodeUTF8))
开发者ID:gobstones,项目名称:pygobstones,代码行数:13,代码来源:viewResults.py


示例9: closeApp

    def closeApp(self, event):

        if self.mainW.ui.textEditFile.document().isModified() or self.mainW.ui.textEditLibrary.document().isModified():
            val = QMessageBox.question(
                self.mainW,
                i18n("Save changes?"),
                i18n("There are unsaved files, you want to close the application?"),
                QMessageBox.Yes,
                QMessageBox.No,
            )
            if val == QMessageBox.Yes:
                event.accept()
            else:
                event.ignore()
开发者ID:gobstones,项目名称:pygobstones,代码行数:14,代码来源:fileOption.py


示例10: setFinalBoard

 def setFinalBoard(self, boardV):
     boardV.setParent(self.ui.tabWidgetResults)
     self.ui.tabWidgetResults.insertTab(2,boardV,i18n('Final Board'))
     if not boardV.is_board_error():
         self.finalBoard = boardV.getBoard()
     else:
         self.ui.pushButtonSaveResults.setVisible(False)
开发者ID:gobstones,项目名称:pygobstones,代码行数:7,代码来源:resultsMainWindow.py


示例11: makeRelationshipBetweenSizeAndHead

 def makeRelationshipBetweenSizeAndHead(self, s):
     if(s == 'dimensions random'):
         self.ui.comboBox_3.clear()
         self.ui.comboBox_3.addItem(i18n('head random'))
     if(s == 'enter dimensions' or s == 'current conservation dimensions'):
         self.ui.comboBox_3.clear()
         self.initCombo3HeadPosition()
     self.ui.comboBox_3.update()
开发者ID:gobstones,项目名称:pygobstones,代码行数:8,代码来源:boardOption.py


示例12: acceptBoardSize

 def acceptBoardSize(self):
     y = self.heightLE.text()
     x = self.widthLE.text()
     if (self.isValidInt(x, 1) and self.isValidInt(y, 1)):
         self.setBoardSize(int(self.widthLE.text()), int(self.heightLE.text()))
         self.widgetSize.close()
     else:
         ErrorWindow(i18n("You must enter integers greater than zero!"))
开发者ID:gobstones,项目名称:pygobstones,代码行数:8,代码来源:boardOption.py


示例13: makeRelationshipBetweenHeadAndSize

 def makeRelationshipBetweenHeadAndSize(self, s):
     if(s == 'enter coordinate' or s == 'current conservation coordinate'):
         self.ui.comboBox_2.clear()
         self.ui.comboBox_2.addItem(i18n('current conservation dimensions'))
     if(s == 'head random'):
         self.ui.comboBox_2.clear()
         self.initCombo2SizeDimensions()
     self.ui.comboBox_2.update()
开发者ID:gobstones,项目名称:pygobstones,代码行数:8,代码来源:boardOption.py


示例14: run

 def run(self):
     self.ui.logger.clear()
     if MainWindow.getPreference('logger') == False:
         self.setPreference('logger', True)
         self.initLoggerSize()
     self.guiInterpreterHandler.wasStoped = False
     self.guiInterpreterHandler.showInLog(i18n(
                             'Start execution || Languaje: ') + self.lang)
     self.guiInterpreterHandler.log('----------------' +
            unicode(datetime.datetime.now())[:19] +
           '-----------------')
     self.ui.logger.show()
     self.ui.actionStop.setEnabled(True)
     self.ui.actionCheck.setEnabled(False)
     self.ui.statusbar.showMessage(QtCore.QString(i18n('Processing...')))
     self.programRun.handler = self.guiInterpreterHandler
     self.runButton.start(self.programRun)
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:17,代码来源:mainWindow.py


示例15: acceptHeadPosition

 def acceptHeadPosition(self):
     y = self.heightLE.text()
     x = self.widthLE.text()
     if (self.isValidIntAndPosition(x,y)):
         self.initialBoardGenerator.setHead(int(x), int(y))
         self.widgetSize.close()
     else:
         ErrorWindow(i18n("You must enter integers less or equal than ({0},{1})").
         format(self.initialBoardGenerator.board.getX()-1,self.initialBoardGenerator.board.getY()-1))
开发者ID:gobstones,项目名称:pygobstones,代码行数:9,代码来源:boardOption.py


示例16: __init__

 def __init__(self, mainW):
     super(PreferencesWindow, self).__init__()
     self.mainW = mainW
     self.setGeometry(300, 300, 300, 150)
     self.setMaximumSize(300,150)
     self.setWindowTitle(i18n('Preferences'))
     self.setStyleSheet("QDialog {background-color:'white'; border:2px solid #4682b4; border-color:'#4682b4';}")
     self.initActions()
     self.exec_()
开发者ID:gobstones,项目名称:pygobstones,代码行数:9,代码来源:preferencesWindow.py


示例17: initialStatus

 def initialStatus(self, partialBoard):
     if (self.load_views is None) or (self.load_views != root_path()):
         self.reset_clothing()
         self.loadViewAlternatives()
         self.load_views = root_path()
     self.boardV = BoardViewer(self, parseABoardString(partialBoard), self.mainW.getClothing())
     self.boardV.setParent(self.ui.boardViewer)
     self.ui.boardViewer.removeTab(0)
     self.ui.boardViewer.insertTab(0, self.boardV, i18n('Board'))
     self.setPressAKeyState()
     self.init_switcher()
开发者ID:ncastrohub,项目名称:labo_tp_2s_2015,代码行数:11,代码来源:mainWindow.py


示例18: newFile

    def newFile(self):

        if self.mainW.ui.textEditFile.document().isModified():
            val = QMessageBox.question(
                self.mainW,
                i18n("Save changes?"),
                i18n("The file %s was changed, Do you save changes?") % (self.mainW.ui.tabWidgetEditors.tabText(0)[3:]),
                QMessageBox.Yes,
                QMessageBox.No,
                QMessageBox.Cancel,
            )
            if val == QMessageBox.Yes:
                self.saveFile()
            elif val == QMessageBox.Cancel:
                return
        self.moduleFile = None
        self.clearCurrentModule()
        if clothing_dir_for_file(str(self.moduleFile)):
            self.updateClothingOptions()
            self.mainW.setClothing("Gobstones.xml")
开发者ID:gobstones,项目名称:pygobstones,代码行数:20,代码来源:fileOption.py


示例19: updateClothingOptions

    def updateClothingOptions(self):
        if clothing_for_file_exists(str(self.moduleFile)):
            path = clothing_dir_for_file(str(self.moduleFile))
            files = os.listdir(path)
        else:
            files = []
        self.mainW.ui.menuSelectResultView.clear()
        self.filesNames = []
        for f in files:
            fileName, fileExtension = os.path.splitext(os.path.join(path, f))
            if fileExtension == ".xml":
                self.filesNames.append(os.path.join(path, fileName))

        self.mapper = QtCore.QSignalMapper(self.mainW)
        self.actions = {}
        for fn in self.filesNames:
            (filepath, filename) = os.path.split(fn)
            self.addClothing(fn, filename)

        self.addClothing("Gobstones", i18n("Gobstones Standard"))
        self.addClothing("PixelBoard", i18n("Pixel Board"))
        self.mapper.mapped["QString"].connect(self.handleButton)
开发者ID:gobstones,项目名称:pygobstones,代码行数:22,代码来源:fileOption.py


示例20: openFiles

    def openFiles(self):

        if self.mainW.ui.textEditFile.document().isModified() or self.mainW.ui.textEditLibrary.document().isModified():
            val = QMessageBox.question(
                self.mainW,
                i18n("Warning!"),
                i18n("There are unsaved files, to load a new module changes will be lost, continue?"),
                QMessageBox.Yes,
                QMessageBox.Cancel,
            )
            if val == QMessageBox.Cancel:
                return False

        filename = openFileName(self.mainW, "*.gbs")

        if not filename == "":
            if not self.wantOpenLibrary(filename):
                self.moduleFile = filename
                fname = open(filename)
                data = fname.read()
                string = QtCore.QString()
                data = string.fromUtf8(data)
                self.mainW.ui.textEditFile.setPlainText(data)
                self.setTabsNamesAndLabelButtonNameAndSetCurrentPathDirectory(filename)
                self.loadLibrary()
                fname.close()
            else:
                QMessageBox.question(
                    self.mainW,
                    i18n("Error loading the file"),
                    i18n("Must load a file different to library")
                    + "\n"
                    + i18n("If you want edit the library, use the corresponding tab"),
                    QMessageBox.Ok,
                )
                return False
        self.createInitialsFoldersAndFiles()
        self.updateClothingOptions()
        return True
开发者ID:gobstones,项目名称:pygobstones,代码行数:39,代码来源:fileOption.py



注:本文中的pygobstones.commons.i18n函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python i18n.i18n函数代码示例发布时间:2022-05-25
下一篇:
Python pygmsh.generate_mesh函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap