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
e8c9a52f
Commit
e8c9a52f
authored
Dec 14, 2017
by
Wolfgang Rohdewald
Browse files
move currentLanguages() from KGlobal to MLocale
parent
4830f6ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/kdestub.py
View file @
e8c9a52f
...
...
@@ -212,7 +212,7 @@ class KApplication(QApplication):
def
initQtTranslator
(
self
):
"""load translators using Qt .qm files"""
for
language
in
reversed
(
list
(
MLocale
.
extendRegionLanguages
(
KGlob
al
.
currentLanguages
()))):
for
language
in
reversed
(
list
(
MLocale
.
extendRegionLanguages
(
MLoc
al
e
.
currentLanguages
()))):
self
.
installTranslatorFile
(
os
.
path
.
join
(
QLibraryInfo
.
location
(
QLibraryInfo
.
TranslationsPath
),
'qtbase_{}.qm'
.
format
(
language
)))
self
.
installTranslatorFile
(
'/usr/share/locale/{}/LC_MESSAGES/kwidgetsaddons5_qt.qm'
.
format
(
language
))
...
...
@@ -723,22 +723,11 @@ class KGlobal:
"""stub"""
@
classmethod
def
currentLanguages
(
cls
):
"""the currently used languages, primary first"""
languages
=
Internal
.
kajonggrc
.
group
(
'Locale'
).
readEntry
(
'Language'
)
if
not
languages
:
return
list
()
languages
=
languages
.
split
(
':'
)
if
'en_US'
in
languages
:
languages
.
remove
(
'en_US'
)
return
languages
@
classmethod
def
initStatic
(
cls
):
"""init class members"""
Internal
.
kajonggrc
=
KConfig
()
MLocale
.
installTranslations
(
cls
.
currentLanguages
())
MLocale
.
installTranslations
(
MLocale
.
currentLanguages
())
class
KConfig
(
ConfigParser
):
...
...
src/mi18n.py
View file @
e8c9a52f
...
...
@@ -218,6 +218,16 @@ class MLocale:
result
.
insert
(
0
,
LOCALEPATH
)
return
result
@
classmethod
def
currentLanguages
(
cls
):
"""the currently used languages, primary first"""
languages
=
Internal
.
kajonggrc
.
group
(
'Locale'
).
readEntry
(
'Language'
)
if
not
languages
:
return
list
()
languages
=
languages
.
split
(
':'
)
if
'en_US'
in
languages
:
languages
.
remove
(
'en_US'
)
return
languages
@
staticmethod
def
extendRegionLanguages
(
languages
):
...
...
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