Skip to content

Commit

Permalink
language switch fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
berkaygediz committed Nov 8, 2024
1 parent e12ba1c commit 3cb8fdf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions RichSpan.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ def initUI(self):
self.setWindowModality(Qt.WindowModality.ApplicationModal)
self.setMinimumSize(768, 540)
system_language = locale.getlocale()[1]
settings = QSettings("berkaygediz", "RichSpan")
if system_language not in languages.keys():
if system_language not in languages.items():
settings.setValue("appLanguage", "1252")
settings.sync()
if settings.value("adaptiveResponse") == None:
Expand Down Expand Up @@ -136,7 +135,6 @@ def initUI(self):
)

def closeEvent(self, event):
settings = QSettings("berkaygediz", "RichSpan")
if self.is_saved == False:
reply = QMessageBox.question(
self,
Expand Down Expand Up @@ -194,7 +192,7 @@ def textChanged(self):
def updateStatistics(self):
self.text_changed_timer.stop()
self.thread_running = False
settings = QSettings("berkaygediz", "RichSpan")
lang = settings.value("appLanguage")
text = self.DocumentArea.toPlainText()
character_count = len(text)
word_count = len(text.split())
Expand Down Expand Up @@ -501,7 +499,6 @@ def initArea(self):
self.DocumentArea.document().setDocumentMargin(self.width() * 0.25)

def initDock(self):
lang = settings.value("appLanguage")
self.dock_widget = QDockWidget(f"{translations[lang]["help"]} && AI", self)
self.dock_widget.setObjectName("Help & AI")
self.dock_widget.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
Expand Down

0 comments on commit 3cb8fdf

Please sign in to comment.