added method to get only a language country code (fr for fr-fr, etc)
This commit is contained in:
parent
bc35c1865d
commit
e50a411a49
@ -11,6 +11,14 @@ def get_language():
|
||||
return config_utils.get_in_config("LANGUAGE")
|
||||
|
||||
|
||||
def get_language_only_country():
|
||||
"""
|
||||
Returns something like "fr" for "fr-fr" in config or "en" for "en-us"
|
||||
:return: language's country initials
|
||||
"""
|
||||
return get_language().split("-")[0]
|
||||
|
||||
|
||||
def get_language_full_name(name=None):
|
||||
"""
|
||||
Return for exemple french for fr-fr, english for en-en, etc (savec in languages.json in the config folder)
|
||||
|
Reference in New Issue
Block a user