Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Kajongg
Commits
b9c92b44
Commit
b9c92b44
authored
Dec 15, 2017
by
Wolfgang Rohdewald
Browse files
KApplication: keep a list of owned QTranslators
parent
f49cc916
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kdestub.py
View file @
b9c92b44
...
...
@@ -75,6 +75,8 @@ class KApplication(QApplication):
# Qt uses sys.argv[0] as application name
# which is used by QStandardPaths - if we start kajongg.py directly,
# the search path would look like /usr/share/kajongg.py/
self
.
translators
=
[]
self
.
setApplicationName
(
'kajongg'
)
self
.
setApplicationVersion
(
str
(
Internal
.
defaultPort
))
...
...
@@ -86,12 +88,16 @@ class KApplication(QApplication):
translator
=
KDETranslator
(
self
)
translator
.
load
(
qmName
)
self
.
installTranslator
(
translator
)
self
.
translators
.
append
(
translator
)
if
Debug
.
i18n
:
Internal
.
logger
.
debug
(
'Installed Qt translator from %s'
,
qmName
)
def
initQtTranslator
(
self
):
"""load translators using Qt .qm files"""
for
_
in
self
.
translators
:
self
.
removeTranslator
(
_
)
self
.
translators
=
[]
for
language
in
reversed
(
list
(
MLocale
.
extendRegionLanguages
(
MLocale
.
currentLanguages
()))):
self
.
installTranslatorFile
(
os
.
path
.
join
(
QLibraryInfo
.
location
(
QLibraryInfo
.
TranslationsPath
),
'qtbase_{}.qm'
.
format
(
language
)))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment