Python PyQt5.QtCore.QCoreApplication.translate() Examples
The following are 30
code examples of PyQt5.QtCore.QCoreApplication.translate().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PyQt5.QtCore.QCoreApplication
, or try the search function
.
Example #1
Source File: progress.py From persepolis with GNU General Public License v3.0 | 9 votes |
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)
Example #2
Source File: binance_order.py From Pythonic with GNU General Public License v3.0 | 7 votes |
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)
Example #3
Source File: basic_ta.py From Pythonic with GNU General Public License v3.0 | 7 votes |
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)
Example #4
Source File: progress.py From persepolis with GNU General Public License v3.0 | 6 votes |
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)
Example #5
Source File: binance_order.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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)
Example #6
Source File: citylistdlg.py From meteo-qt with GNU General Public License v3.0 | 6 votes |
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)
Example #7
Source File: citytranslate.py From meteo-qt with GNU General Public License v3.0 | 6 votes |
def __init__(self, city, cities_list, parent=None): super(CityTranslate, self).__init__(parent) self.city = city self.settings = QSettings() self.trans_cities_dict = cities_list self.layout = QVBoxLayout() self.buttonLayout = QHBoxLayout() self.buttonBox = QDialogButtonBox() self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons( QDialogButtonBox.Ok | QDialogButtonBox.Cancel ) self.buttonBox.rejected.connect(self.reject) self.buttonBox.accepted.connect(self.accept) self.buttonLayout.addWidget(self.buttonBox) self.untranslate_city_label = QLabel(self.find_city_key(self.city)) self.translate_line = QLineEdit(self.city) self.translate_line.selectAll() self.translate_line.setMinimumWidth(300) self.status_layout = QHBoxLayout() self.status_label = QLabel() self.status_layout.addWidget(self.status_label) self.panel = QGridLayout() self.panel.addWidget(self.untranslate_city_label, 0, 0) self.panel.addWidget(self.translate_line, 1, 0) self.layout.addLayout(self.panel) self.layout.addLayout(self.status_layout) self.layout.addLayout(self.buttonLayout) self.setLayout(self.layout) self.setWindowTitle(QCoreApplication.translate('Window title', 'City translation', 'City translation dialogue'))
Example #8
Source File: video_finder_progress.py From persepolis with GNU General Public License v3.0 | 6 votes |
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)
Example #9
Source File: video_finder_progress.py From persepolis with GNU General Public License v3.0 | 6 votes |
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)
Example #10
Source File: basic_ta.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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)
Example #11
Source File: basic_ta.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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)
Example #12
Source File: basic_sched.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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)
Example #13
Source File: basic_sched.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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)
Example #14
Source File: basic_process.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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()
Example #15
Source File: main.py From Pythonic with GNU General Public License v3.0 | 6 votes |
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()
Example #16
Source File: basic_operation.py From Pythonic with GNU General Public License v3.0 | 5 votes |
def loadLastConfig(self): logging.debug('ExecOp::loadLastConfig() called') log_state, code_input, custom_edit_state, cmd = self.config self.log_checkbox.setChecked(log_state) self.custom_editor_checkbox.setChecked(custom_edit_state) if code_input: self.code_input.setPlainText(code_input) else: self.placeholder_1 = QC.translate('', '""" use the variable input to access data from previous elements """') self.placeholder_2 = QC.translate('', '""" set the output variable to pass data to following elements """') self.placeholder_3 = QC.translate('', '""" set the variable log_txt to adjust the logging text """') self.code_input.setPlaceholderText(self.placeholder_1 + '\r\n\r\n' + 'print(input)\r\n\r\n' + self.placeholder_2 + '\r\n\r\n' + 'output = 5\r\n\r\n' + self.placeholder_3 + '\r\n\r\n' + 'log_txt = "debug text"') if cmd: self.custom_editor_cmd.setText(cmd) else: if os.name == 'nt': self.custom_editor_cmd.setPlaceholderText(r'C:\"Program Files (x86)"\Notepad++\notepad++.exe $FILENAME') else: self.custom_editor_cmd.setPlaceholderText('gnome-terminal --wait -e "vim $FILENAME"') if custom_edit_state: self.code_input.setEnabled(False) self.custom_editor_cmd.setEnabled(True) self.openCustomEditor(cmd, code_input) else: self.code_input.setEnabled(True) self.custom_editor_cmd.setEnabled(False)
Example #17
Source File: reduce_trajectory_density.py From Offline-MapMatching with GNU General Public License v3.0 | 5 votes |
def tr(self, string): return QCoreApplication.translate('Processing', string)
Example #18
Source File: calculate_all_shortest_paths.py From Offline-MapMatching with GNU General Public License v3.0 | 5 votes |
def tr(self, string): return QCoreApplication.translate('Processing', string)
Example #19
Source File: clip_network_algorithm.py From Offline-MapMatching with GNU General Public License v3.0 | 5 votes |
def tr(self, string): return QCoreApplication.translate('Processing', string)
Example #20
Source File: basic_sched.py From Pythonic with GNU General Public License v3.0 | 5 votes |
def interval(self): logging.debug('interval() called') self.interval_input = QWidget() self.interval_layout = QVBoxLayout(self.interval_input) self.time_base_input_line = QWidget() self.time_base_input_layout = QHBoxLayout(self.time_base_input_line) self.interval_txt = QLabel() self.interval_txt.setText(QC.translate('', 'Every')) self.repeat_val_input = QLineEdit() self.repeat_val_input.setValidator(QIntValidator(1, 9999)) self.repeat_val_input.setText('1') self.time_base_input = QComboBox() self.time_base_input.addItem(QC.translate('', 'Seconds'), QVariant('sec')) self.time_base_input.addItem(QC.translate('', 'Minutes'), QVariant('min')) self.time_base_input.addItem(QC.translate('', 'Hours'), QVariant('hour')) self.time_base_input_layout.addWidget(self.repeat_val_input) self.time_base_input_layout.addWidget(self.time_base_input) self.interval_layout.addWidget(self.interval_txt) self.interval_layout.addWidget(self.time_base_input_line) self.interval_input.hide() self.options_box_layout.addWidget(self.interval_input)
Example #21
Source File: basic_branch.py From Pythonic with GNU General Public License v3.0 | 5 votes |
def initUI(self): self.selectCondition = QComboBox() self.selectCondition.addItem(QC.translate('', 'Greater than (>) ...'), QVariant('>')) self.selectCondition.addItem(QC.translate('', 'Greater or equal than (>=) ...'), QVariant('>=')) self.selectCondition.addItem(QC.translate('', 'Less than (<) ...'), QVariant('<')) self.selectCondition.addItem(QC.translate('', 'Less or equal than (<=) ...'), QVariant('<=')) self.selectCondition.addItem(QC.translate('', 'Equal to (==) ...'), QVariant('==')) self.selectCondition.addItem(QC.translate('', 'NOT equal to (!=) ...'), QVariant('!=')) self.selectCondition.setCurrentIndex(0) #self.addFunction(BranchFunction)
Example #22
Source File: basic_stack.py From Pythonic with GNU General Public License v3.0 | 5 votes |
def enableArrLimits(self): self.max_array_elements.setEnabled(True) self.max_array_elements.setPlaceholderText(QC.translate('', 'Default value: 20'))
Example #23
Source File: offline_map_matching_algorithm.py From Offline-MapMatching with GNU General Public License v3.0 | 5 votes |
def tr(self, string): return QCoreApplication.translate('Processing', string)
Example #24
Source File: map_matching_preparation_algorithm.py From Offline-MapMatching with GNU General Public License v3.0 | 5 votes |
def tr(self, string): return QCoreApplication.translate('Processing', string)
Example #25
Source File: kbd.py From ftcommunity-TXT with GNU General Public License v3.0 | 5 votes |
def status(): if keyboard_present(): return QCoreApplication.translate("PluginKbd","Available") else: return QCoreApplication.translate("PluginKbd","Not available")
Example #26
Source File: kbd.py From ftcommunity-TXT with GNU General Public License v3.0 | 5 votes |
def name(): return QCoreApplication.translate("PluginKbd", "Keyboard")
Example #27
Source File: eth.py From ftcommunity-TXT with GNU General Public License v3.0 | 5 votes |
def status(): carrier = get_carrier() if carrier != None: if carrier == 1: ip = get_ip() if ip: return QCoreApplication.translate("PluginEth", "Up, ") + ip else: return QCoreApplication.translate("PluginEth", "Up, no IP address") else: return QCoreApplication.translate("PluginEth", "No link") else: return QCoreApplication.translate("PluginEth", "Not available")
Example #28
Source File: eth.py From ftcommunity-TXT with GNU General Public License v3.0 | 5 votes |
def name(): return QCoreApplication.translate("PluginEth", "Ethernet")
Example #29
Source File: bluetooth.py From ftcommunity-TXT with GNU General Public License v3.0 | 5 votes |
def status(): state = hci0_up() if state == True: return QCoreApplication.translate("PluginBluetooth", "Enabled") elif state == False: return QCoreApplication.translate("PluginBluetooth", "Disabled") else: return QCoreApplication.translate("PluginBluetooth", "Not available")
Example #30
Source File: wlan.py From ftcommunity-TXT with GNU General Public License v3.0 | 5 votes |
def status(): operstate = get_operstate() if operstate: if operstate == "up": ip = get_ip() if ip: return QCoreApplication.translate("PluginWlan", "Up, ") + ip else: return QCoreApplication.translate("PluginWlan", "Up, no IP address") else: return operstate else: return QCoreApplication.translate("PluginWlan", "Not available")