當前位置: 首頁>>代碼示例>>Python>>正文


Python QCoreApplication.translate方法代碼示例

本文整理匯總了Python中PyQt5.QtCore.QCoreApplication.translate方法的典型用法代碼示例。如果您正苦於以下問題:Python QCoreApplication.translate方法的具體用法?Python QCoreApplication.translate怎麽用?Python QCoreApplication.translate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtCore.QCoreApplication的用法示例。


在下文中一共展示了QCoreApplication.translate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: resumePushButtonPressed

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def resumePushButtonPressed(self, button):

        if self.status == "paused":
            answer = download.downloadUnpause(self.gid)

            # if aria2 did not respond , then this function is checking for aria2
            # availability , and if aria2 disconnected then aria2Disconnected is
            # executed
            if not(answer):
                version_answer = download.aria2Version()
                if version_answer == 'did not respond':
                    self.parent.aria2Disconnected()
                    notifySend(QCoreApplication.translate("progress_src_ui_tr", "Aria2 disconnected!"), QCoreApplication.translate("progress_src_ui_tr", "Persepolis is trying to connect! be patient!"),
                               10000, 'warning', parent=self.parent)
                else:
                    notifySend(QCoreApplication.translate("progress_src_ui_tr", "Aria2 did not respond!"), QCoreApplication.translate("progress_src_ui_tr", "Please try again."), 10000,
                               'warning', parent=self.parent) 
開發者ID:persepolisdm,項目名稱:persepolis,代碼行數:19,代碼來源:progress.py

示例2: stopLoss

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def stopLoss(self):

        logging.debug('BinanceOrder::stopLoss() called')

        self.stop_loss_input = QWidget()
        self.stop_loss_layout = QVBoxLayout(self.stop_loss_input)

        self.stop_loss_price_txt = QLabel()
        self.stop_loss_price_txt.setText(QC.translate('', 'Stop price:'))

        self.stop_loss_price_input = QLineEdit()
        self.stop_loss_price_input.setValidator(QDoubleValidator(999999, -999999, 8))

        self.stop_loss_params = QLabel()
        self.stop_loss_params.setText(
                '{\'stopPrice\' : 12.345, \'quantity\' : 0.005}')


        self.stop_loss_layout.addWidget(self.stop_loss_price_txt)
        self.stop_loss_layout.addWidget(self.stop_loss_price_input)
        self.stop_loss_layout.addWidget(self.stop_loss_params)
        self.stop_loss_layout.addStretch(1)

        self.order_box.addWidget(self.stop_loss_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:26,代碼來源:binance_order.py

示例3: maInput

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def maInput(self):

        self.ma_input = QWidget()
        self.ma_layout = QHBoxLayout(self.ma_input)

        self.ma_range_txt = QLabel()
        self.ma_range_txt.setText(QC.translate('', 'Enter time range MA'))

        self.ma_range_input = QLineEdit()
        self.ma_range_input.setValidator(QIntValidator(1, 999))
        self.ma_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.ma_layout.addWidget(self.ma_range_txt)
        self.ma_layout.addWidget(self.ma_range_input)


        self.variable_box.addWidget(self.ma_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:19,代碼來源:basic_ta.py

示例4: pausePushButtonPressed

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def pausePushButtonPressed(self, button):

        if self.status == "downloading":
            answer = download.downloadPause(self.gid)

            # if aria2 did not respond , then this function is checking for aria2
            # availability , and if aria2 disconnected then aria2Disconnected is
            # executed
            if not(answer):
                version_answer = download.aria2Version()
                if version_answer == 'did not respond':
                    self.parent.aria2Disconnected()
                    download.downloadStop(self.gid, self.parent)
                    notifySend("Aria2 disconnected!", "Persepolis is trying to connect! be patient!",
                               10000, 'warning', parent=self.parent)
                else:
                    notifySend(QCoreApplication.translate("progress_src_ui_tr", "Aria2 did not respond!"), QCoreApplication.translate("progress_src_ui_tr", "Try again!"), 10000,
                               'critical', parent=self.parent) 
開發者ID:persepolisdm,項目名稱:persepolis,代碼行數:20,代碼來源:progress.py

示例5: stopPushButtonPressed

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def stopPushButtonPressed(self, button):

        # cancel shut down progress
        dictionary = {'category': self.video_finder_plus_gid,
                      'shutdown': 'canceled'}

        self.parent.temp_db.updateQueueTable(dictionary)

        answer = download.downloadStop(self.gid, self.parent)

        # if aria2 did not respond , then this function is checking for aria2
        # availability , and if aria2 disconnected then aria2Disconnected is
        # executed
        if answer == 'None':
            version_answer = download.aria2Version()
            if version_answer == 'did not respond':
                self.parent.aria2Disconnected()
                notifySend(QCoreApplication.translate("progress_src_ui_tr", "Aria2 disconnected!"), QCoreApplication.translate("progress_src_ui_tr", "Persepolis is trying to connect! be patient!"),
                           10000, 'warning', parent=self.parent) 
開發者ID:persepolisdm,項目名稱:persepolis,代碼行數:21,代碼來源:video_finder_progress.py

示例6: remove

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def remove(self):
        self.status.setText('')
        if self.listWidget.count() == 1:
            self.status.setText(
                QCoreApplication.translate(
                    'Message when trying to remove the'
                    'last and unique city in the list',
                    'This is the default city!',
                    'Cities list dialogue'
                )
            )
            return
        row = self.listWidget.currentRow()
        item = self.listWidget.item(row)
        if item is None:
            return
        message = self.tr('The city "{0}" has been removed').format(
            self.listWidget.item(row).text())
        item = self.listWidget.takeItem(row)
        del item
        self.status.setText(message) 
開發者ID:dglent,項目名稱:meteo-qt,代碼行數:23,代碼來源:citylistdlg.py

示例7: takeProfit

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def takeProfit(self):

        logging.debug('BinanceOrder::takeProfit() called')

        self.take_profit_input = QWidget()
        self.take_profit_layout = QVBoxLayout(self.take_profit_input)

        self.take_profit_stop_price = QLabel()
        self.take_profit_stop_price.setText(QC.translate('', 'Stop price:'))

        self.take_profit_stop_price_input = QLineEdit()
        self.take_profit_stop_price_input.setValidator(QDoubleValidator(999999, -999999, 8))

        self.take_profit_params = QLabel()
        self.take_profit_params.setText(
                '{\'stopPrice\': 12.345, \'quantity\' : 0.005}')


        self.take_profit_layout.addWidget(self.take_profit_stop_price)
        self.take_profit_layout.addWidget(self.take_profit_stop_price_input)
        self.take_profit_layout.addWidget(self.take_profit_params)
        self.take_profit_layout.addStretch(1)

        self.order_box.addWidget(self.take_profit_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:26,代碼來源:binance_order.py

示例8: stoInput

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def stoInput(self):

        self.sto_input = QWidget()
        self.sto_layout = QHBoxLayout(self.sto_input)

        self.sto_range_txt = QLabel()
        self.sto_range_txt.setText(QC.translate('', 'Enter MA period'))

        self.sto_range_input = QLineEdit()
        self.sto_range_input.setValidator(QIntValidator(1, 999))
        self.sto_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.sto_layout.addWidget(self.sto_range_txt)
        self.sto_layout.addWidget(self.sto_range_input)

        self.variable_box.addWidget(self.sto_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:18,代碼來源:basic_ta.py

示例9: rsiInput

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def rsiInput(self):

        self.rsi_input = QWidget()
        self.rsi_layout = QHBoxLayout(self.rsi_input)

        self.rsi_range_txt = QLabel()
        self.rsi_range_txt.setText(QC.translate('', 'Enter periods'))

        self.rsi_range_input = QLineEdit()
        self.rsi_range_input.setValidator(QIntValidator(1, 999))
        self.rsi_range_input.setPlaceholderText(QC.translate('', 'Default value: 3'))

        self.rsi_layout.addWidget(self.rsi_range_txt)
        self.rsi_layout.addWidget(self.rsi_range_input)

        self.variable_box.addWidget(self.rsi_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:18,代碼來源:basic_ta.py

示例10: at_time

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def at_time(self):

        logging.debug('at_time() called')

        self.at_time_input = QWidget()
        self.at_time_layout = QVBoxLayout(self.at_time_input)

        self.time_text = QLabel()
        self.time_text.setText(QC.translate('', 'At:'))

        self.time_input = QLineEdit()
        regexp_validator = QRegExp('^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$')
        self.time_validator = QRegExpValidator(regexp_validator)
        self.time_input.setValidator(self.time_validator)
        self.time_input.setPlaceholderText(QC.translate('', 'hh:mm'))

        self.at_time_layout.addWidget(self.time_text)
        self.at_time_layout.addWidget(self.time_input)

        self.at_time_input.hide()
        self.options_box_layout.addWidget(self.at_time_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:23,代碼來源:basic_sched.py

示例11: full_interval

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def full_interval(self):

        logging.debug('full_interval() called')

        self.full_interval_input = QWidget()
        self.full_interval_layout = QVBoxLayout(self.full_interval_input)

        self.description_1 = QLabel()
        self.description_1.setText(QC.translate('', 'For instance a 15 minute interval executes every full'))
        
        self.description_2 = QLabel()
        self.description_2.setText(QC.translate('', '15 minutes: 10:00, 10:15, 10:30, 10:45, ...'))

        self.full_interval_layout.addWidget(self.description_1)
        self.full_interval_layout.addWidget(self.description_2)

        self.full_interval_input.hide()

        self.options_box_layout.addWidget(self.full_interval_input) 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:21,代碼來源:basic_sched.py

示例12: edit

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def edit(self):
        logging.debug('edit() called ExecBranch')
        self.procEditLayout = QVBoxLayout()

        self.procEdit = ElementEditor(self)
        self.procEdit.setWindowTitle(QC.translate('', 'Edit Process Branch'))

        self.help_text = QLabel()
        self.help_text.setText(QC.translate('', 'Multiprocessing: Start a new execution path.')) 

        self.procEditLayout.addWidget(self.help_text)
        self.procEditLayout.addStretch(1)
        self.procEdit.setLayout(self.procEditLayout)

        
        self.procEdit.show() 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:18,代碼來源:basic_process.py

示例13: loadGrid

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def loadGrid(self, filename):

        logging.debug('MainWindow::loadGrid() called')
        grid_data_list = []
        try:
            with ZipFile(filename, 'r') as archive:
                for zipped_grid in archive.namelist():
                    pickled_grid = archive.read(zipped_grid)
                    element_list = pickle.loads(pickled_grid)
                    # first char repesents the grid number
                    self.wrk_area_arr[int(zipped_grid[0])].loadGrid(pickle.loads(pickled_grid))
            archive.close()

        except Exception as e:
            err_msg = QMessageBox()
            err_msg.setIcon(QMessageBox.Critical)
            err_msg.setWindowTitle(QC.translate('', 'File Error'))
            err_msg.setText(QC.translate('', 'File can\'t be read'))
            err_msg.setAttribute(Qt.WA_DeleteOnClose)
            err_msg.exec() 
開發者ID:hANSIc99,項目名稱:Pythonic,代碼行數:22,代碼來源:main.py

示例14: tr

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def tr(self, message):
        """Get the translation for a string using Qt translation API.

        We implement this ourselves since we do not inherit QObject.

        :param message: String for translation.
        :type message: str, QString

        :returns: Translated version of message.
        :rtype: QString
        """
        # noinspection PyTypeChecker,PyArgumentList,PyCallByClass
        return QCoreApplication.translate('RasterVisionPlugin', message) 
開發者ID:azavea,項目名稱:raster-vision-qgis,代碼行數:15,代碼來源:raster_vision.py

示例15: test_qgis_translations

# 需要導入模塊: from PyQt5.QtCore import QCoreApplication [as 別名]
# 或者: from PyQt5.QtCore.QCoreApplication import translate [as 別名]
def test_qgis_translations(self):
        """Test that translations work."""
        parent_path = os.path.join(__file__, os.path.pardir, os.path.pardir)
        dir_path = os.path.abspath(parent_path)
        file_path = os.path.join(
            dir_path, 'i18n', 'af.qm')
        translator = QTranslator()
        translator.load(file_path)
        QCoreApplication.installTranslator(translator)

        expected_message = 'Goeie more'
        real_message = QCoreApplication.translate("@default", 'Good morning')
        self.assertEqual(real_message, expected_message) 
開發者ID:azavea,項目名稱:raster-vision-qgis,代碼行數:15,代碼來源:test_translations.py


注:本文中的PyQt5.QtCore.QCoreApplication.translate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。