mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
mediawiki: Simplify retrieving the default language
- Mostly to avoid a repeated call to retrieve the list of changes. - If an unknown value is read, user experience in terms of listed languages and resetting the new language won't change. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
f3621a274d
commit
3d1beaf640
@ -14,7 +14,7 @@ from plinth.modules.backups.components import BackupRestore
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.package import Packages
|
||||
|
||||
from . import forms, manifest, privileged
|
||||
from . import manifest, privileged
|
||||
|
||||
_description = [
|
||||
_('MediaWiki is the wiki engine that powers Wikipedia and other WikiMedia '
|
||||
@ -155,10 +155,4 @@ def get_site_name():
|
||||
|
||||
def get_default_language():
|
||||
"""Return the value of MediaWiki's default language"""
|
||||
default_lang_key = _get_config_value('$wgLanguageCode')
|
||||
language_choices = forms.get_languages()
|
||||
for code, name in language_choices:
|
||||
if code == default_lang_key:
|
||||
return code
|
||||
|
||||
return None
|
||||
return _get_config_value('$wgLanguageCode') or None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user