language should now be detected automatically
This commit is contained in:
parent
807aac3237
commit
a4863ec512
4 changed files with 18 additions and 5 deletions
8
main.py
8
main.py
|
@ -1,6 +1,6 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from PyQt6.QtCore import QTranslator
|
from PyQt6.QtCore import QTranslator, QLocale
|
||||||
from PyQt6.QtWidgets import QApplication
|
from PyQt6.QtWidgets import QApplication
|
||||||
|
|
||||||
from source import assets_path
|
from source import assets_path
|
||||||
|
@ -11,10 +11,14 @@ if __name__ == "__main__":
|
||||||
# create the application
|
# create the application
|
||||||
application = QApplication(sys.argv)
|
application = QApplication(sys.argv)
|
||||||
|
|
||||||
|
# get the user language
|
||||||
|
local = QLocale()
|
||||||
|
language_code: str = local.languageToCode(local.language())
|
||||||
|
|
||||||
# load the translator to support multiple languages
|
# load the translator to support multiple languages
|
||||||
translator = QTranslator()
|
translator = QTranslator()
|
||||||
application.installTranslator(translator)
|
application.installTranslator(translator)
|
||||||
translator.load(str(assets_path / "language/french.qm"))
|
translator.load(str(assets_path / f"language/{language_code}.qm"))
|
||||||
|
|
||||||
# create the window
|
# create the window
|
||||||
window = MyMainWindow()
|
window = MyMainWindow()
|
||||||
|
|
15
surveys.json
15
surveys.json
|
@ -85,7 +85,7 @@
|
||||||
|
|
||||||
"mission-community-hub": {
|
"mission-community-hub": {
|
||||||
"type": "mission-web",
|
"type": "mission-web",
|
||||||
"title": "Rendez-vous sur le Hub de la Communauté du jeu \",Stray\".",
|
"title": "Rendez-vous sur le Hub de la Communauté du jeu \"Stray\".",
|
||||||
"url": "https://store.steampowered.com/",
|
"url": "https://store.steampowered.com/",
|
||||||
"check": "document.documentURI == 'https://steamcommunity.com/app/1332010'",
|
"check": "document.documentURI == 'https://steamcommunity.com/app/1332010'",
|
||||||
"skip_time": 90
|
"skip_time": 90
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
|
|
||||||
"mission-game-discussion": {
|
"mission-game-discussion": {
|
||||||
"type": "mission-web",
|
"type": "mission-web",
|
||||||
"title": "Trouver la page de Discussions du jeu \"Sid Meier's Civilization V\".",
|
"title": "Trouver la page de discussions du jeu \"Sid Meier's Civilization V\".",
|
||||||
"url": "https://store.steampowered.com/",
|
"url": "https://store.steampowered.com/",
|
||||||
"check": "document.documentURI == 'https://steamcommunity.com/app/8930/discussions/'",
|
"check": "document.documentURI == 'https://steamcommunity.com/app/8930/discussions/'",
|
||||||
"skip_time": 180
|
"skip_time": 180
|
||||||
|
@ -152,7 +152,16 @@
|
||||||
"type": "question-single-choice",
|
"type": "question-single-choice",
|
||||||
"title": "Parmi les tâches, laquelle avez-vous trouvée la plus difficile ?",
|
"title": "Parmi les tâches, laquelle avez-vous trouvée la plus difficile ?",
|
||||||
"choices": {
|
"choices": {
|
||||||
"mission-language": "Changer la langue"
|
"mission-language": "Changer la langue",
|
||||||
|
"mission-price": "Filtrer les jeux par leur prix",
|
||||||
|
"mission-community-hub": "Se rendre sur le hub de la communauté",
|
||||||
|
"mission-game-page": "Se rendre sur la page d'un jeu",
|
||||||
|
"mission-game-dlc": "Se rendre sur la page du contenu additionnel (DLC) d'un jeu",
|
||||||
|
"mission-actuality-new": "Se rendre sur la page des actualités",
|
||||||
|
"mission-profile": "Se rendre sur le profil d'un utilisateur",
|
||||||
|
"mission-game-discussion": "Se rendre sur la page de discussion d'un jeu",
|
||||||
|
"mission-gift-card": "Se rendre sur la page des cartes cadeaux",
|
||||||
|
"mission-workshop": "Se rendre sur la page de la modification d'un jeu"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue