feat: added priority to languages
This commit is contained in:
parent
3e6884ad8a
commit
3e692dd74f
@ -119,6 +119,10 @@ class CustomLanguageCode:
|
||||
def native_name(self) -> str:
|
||||
return self._get_additional_data()["native_name"]
|
||||
|
||||
@property
|
||||
def priority(self) -> int:
|
||||
return self._get_additional_data().get("priority", 0)
|
||||
|
||||
|
||||
class Article(CustomPath):
|
||||
def __init__(self, path: CustomPath):
|
||||
@ -209,6 +213,7 @@ class Template:
|
||||
|
||||
overview_card_template = self.get_overview_card_template()
|
||||
|
||||
self.articles.sort(key=lambda a: a.language_code.priority, reverse=True)
|
||||
overview_cards = "\n".join(self._replace_keywords(
|
||||
overview_card_template,
|
||||
**a.get_article_keys(),
|
||||
|
@ -102,7 +102,7 @@ LANGUAGE_INFORMATION = {
|
||||
"ar_sy": {
|
||||
"flag": "🇸🇾",
|
||||
"name": "Arabic (Syria)",
|
||||
"native_name": "العربية (سوريا)"
|
||||
"native_name": "العربية (سوريا)",
|
||||
"priority": 50,
|
||||
},
|
||||
"ar_tn": {
|
||||
@ -281,7 +281,7 @@ LANGUAGE_INFORMATION = {
|
||||
"en_us": {
|
||||
"flag": "🇺🇸",
|
||||
"name": "English (US)",
|
||||
"native_name": "English (US)"
|
||||
"native_name": "English (US)",
|
||||
},
|
||||
"es": {
|
||||
"flag": "🇪🇸",
|
||||
|
Loading…
x
Reference in New Issue
Block a user