Skip to content

Commit

Permalink
[RU] Support "Унбегаун" template
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Dec 27, 2024
1 parent bb45194 commit 79e1357
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion wikidict/lang/ru/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ def last_template_handler(template: tuple[str, ...], locale: str, *, word: str =
>>> last_template_handler(["умласк."], "ru")
'<i>уменьш.-ласк.</i>'
>>> last_template_handler(["Унбегаун"], "ru")
'<i>Унбегаун Б.-О.</i> Русские фамилии. — М. : Прогресс, 1989. — 443 с. — ISBN 5-01-001045-3.'
>>> last_template_handler(["Унбегаун", "сокр=1"], "ru")
'Унбегаун'
#
# Variants
#
Expand All @@ -154,7 +159,7 @@ def last_template_handler(template: tuple[str, ...], locale: str, *, word: str =
from .template_handlers import lookup_template, render_template

tpl, *parts = template
extract_keywords_from(parts)
data = extract_keywords_from(parts)

#
# Variants
Expand All @@ -179,6 +184,11 @@ def last_template_handler(template: tuple[str, ...], locale: str, *, word: str =
if tpl == "выдел":
return parts[0]

if tpl == "Унбегаун":
if data["сокр"] == "1":
return tpl
return f"{italic(tpl + ' Б.-О.')} Русские фамилии. — М. : Прогресс, 1989. — 443 с. — ISBN 5-01-001045-3."

if label := labels.get(tpl):
if tpl == "умласк.":
label = "уменьш.-ласк."
Expand Down

0 comments on commit 79e1357

Please sign in to comment.