- fixed an issue created by the fact that I used the '_' char inside the app to designate unused info and that conflicted with the _() function used by gettext
- made impossible to try to reapply current language that it's already applied (un-necessary)
This commit is contained in:
@@ -60,11 +60,17 @@ def on_language_apply_click(app, restart=False):
|
||||
"""
|
||||
name = app.ui.general_defaults_form.general_app_group.language_cb.currentText()
|
||||
|
||||
# do nothing if trying to apply the language that is the current language (already applied).
|
||||
settings = QSettings("Open Source", "FlatCAM")
|
||||
if settings.contains("language"):
|
||||
current_language = settings.value('language', type=str)
|
||||
if current_language == name:
|
||||
return
|
||||
|
||||
if restart:
|
||||
msgbox = QtWidgets.QMessageBox()
|
||||
|
||||
msgbox.setInformativeText("Are you sure do you want to change the current language to %s?\n\n"
|
||||
"The application will restart." % name.capitalize())
|
||||
msgbox.setText("The application will restart.")
|
||||
msgbox.setInformativeText("Are you sure do you want to change the current language to %s?" % name.capitalize())
|
||||
msgbox.setWindowTitle("Apply Language ...")
|
||||
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
|
||||
msgbox.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.Cancel)
|
||||
@@ -83,7 +89,6 @@ def on_language_apply_click(app, restart=False):
|
||||
|
||||
restart_program(app=app)
|
||||
|
||||
|
||||
def apply_language(domain, lang=None):
|
||||
lang_code = ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user