mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix an IndexError in get_lang_page
This commit is contained in:
parent
b7780682d5
commit
87085cec3c
@ -1000,10 +1000,11 @@ class Helpers:
|
||||
return text
|
||||
|
||||
@staticmethod
|
||||
def get_lang_page(text):
|
||||
lang = text.split("_")[0]
|
||||
region = text.split("_")[1]
|
||||
def get_lang_page(text) -> str:
|
||||
splitted = text.split("_")
|
||||
if len(splitted) != 2:
|
||||
return "en"
|
||||
lang, region = splitted
|
||||
if region == "EN":
|
||||
return "en"
|
||||
else:
|
||||
return lang + "-" + region
|
||||
return lang + "-" + region
|
||||
|
Loading…
Reference in New Issue
Block a user