prepare i18n
This commit is contained in:
16
main.py
16
main.py
@@ -1,5 +1,8 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
from PyQt6 import QtCore
|
||||
from PyQt6.lupdate import lupdate
|
||||
from PyQt6.QtWidgets import *
|
||||
from PyQt6.QtCore import *
|
||||
from PyQt6.QtGui import *
|
||||
@@ -15,9 +18,8 @@ MAX_LINE_LENGTH = 4096
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(MainWindow, self).__init__(*args, **kwargs)
|
||||
|
||||
self.settings = Settings()
|
||||
self.setWindowTitle("RavenLog")
|
||||
self.setWindowTitle(self.tr("RavenLog"))
|
||||
self.setGeometry(0, 0, 640, 480)
|
||||
self.setDockNestingEnabled(True)
|
||||
|
||||
@@ -31,7 +33,7 @@ class MainWindow(QMainWindow):
|
||||
def create_main_tool_bar(self):
|
||||
result = QToolBar("main toolbar")
|
||||
|
||||
result.addWidget(QLabel("Font Size:"))
|
||||
result.addWidget(QLabel(self.tr("Font Size:")))
|
||||
font_size = QComboBox(result)
|
||||
for s in range(3,30):
|
||||
font_size.addItem(str(s))
|
||||
@@ -67,8 +69,8 @@ class MainWindow(QMainWindow):
|
||||
def create_menu_bar(self) -> QMenuBar:
|
||||
menu_bar = QMenuBar()
|
||||
|
||||
file_menu = QMenu("File", self)
|
||||
close_action = QAction("Close", self)
|
||||
file_menu = QMenu(self.tr("File", "name of the file menu"), self)
|
||||
close_action = QAction(self.tr("Close", "menu item to close the application"), self)
|
||||
close_action.triggered.connect(self.close)
|
||||
|
||||
file_menu.addAction(close_action)
|
||||
@@ -84,6 +86,10 @@ class MainWindow(QMainWindow):
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
#translator = QTranslator()
|
||||
#if translator.load(QLocale("de"), "messages_de.ts"):
|
||||
# app.installTranslator(translator)
|
||||
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user