mirror of
https://github.com/PaiGramTeam/FixMiYouShe.git
synced 2024-11-25 09:27:45 +00:00
🐛 Fix lang alias in related posts
This commit is contained in:
parent
e254241302
commit
8f34ecbb5b
@ -109,3 +109,9 @@ class I18n:
|
||||
|
||||
def __getitem__(self, item):
|
||||
return self.get_property(item)
|
||||
|
||||
@property
|
||||
def lang_alias(self) -> str:
|
||||
for k, v in i18n_alias.items():
|
||||
if v == self.lang:
|
||||
return k
|
||||
|
@ -72,7 +72,7 @@ Embed MiYouShe posts, videos, polls, and more on Telegram
|
||||
{% if related_posts %}
|
||||
{% for post_ in related_posts %}
|
||||
<related>
|
||||
{% if i18n.lang.value == 'zh-cn' %}{% set ends = '' %}{% else %}{% set ends = '/' + i18n.lang.value %}{% endif %}
|
||||
{% if i18n.lang.value == 'zh-cn' %}{% set ends = '' %}{% else %}{% set ends = '/' + i18n.lang_alias %}{% endif %}
|
||||
<a href="https://{{ DOMAIN }}/{{ post.url_start }}/{{ post_.post_id }}{{ ends }}">{{ post_.subject }}</a>
|
||||
</related>
|
||||
<br/>
|
||||
|
Loading…
Reference in New Issue
Block a user