Only fallback to existing translation

This commit is contained in:
Jan Brasna 2024-06-19 19:53:46 +02:00 коммит произвёл Stephanie Hobson
Родитель 3a4d7d6732
Коммит 4c9319c15b
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -254,7 +254,7 @@ def ftl_has_messages(l10n, *message_ids, require_all=True):
def translate(l10n, message_id, fallback=None, **kwargs):
# check the `locale` bundle for the message if we have a fallback defined
if fallback and not l10n.has_message(message_id):
if fallback and l10n.has_message(fallback) and not l10n.has_message(message_id):
message_id = fallback
return l10n.format_value(message_id, kwargs)