Skip to content

Commit

Permalink
fix #718: [FR] Improve 'sigle' template
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Feb 14, 2021
1 parent 433f820 commit 76c772b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion wikidict/lang/fr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@
"scol": "Éducation",
"scolaire": "Éducation",
"sexe": "Sexualité",
"sigle": "Sigle",
"SMS": "Langage SMS",
"sociol": "Sociologie",
"sout": "Soutenu",
Expand Down
13 changes: 13 additions & 0 deletions wikidict/lang/fr/template_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,18 @@ def render_siecle2(tpl: str, parts: List[str], data: Dict[str, str]) -> str:
return f"{number}{superscript(suffix)}"


def render_sigle(tpl: str, parts: List[str], data: Dict[str, str]) -> str:
"""
>>> render_sigle("sigle", ["fr"], defaultdict(str))
'<i>(Sigle)</i>'
>>> render_sigle("sigle", ["en"], defaultdict(str, {"de": "United Nations"}))
'Sigle de <i>United Nations</i>'
""" # noqa
if not data["de"]:
return term("Sigle")
return "Sigle de " + italic(data["de"])


def render_suisse(tpl: str, parts: List[str], data: Dict[str, str]) -> str:
"""
>>> render_suisse("Suisse", ["fr"], defaultdict(str, {"précision":"Fribourg, Valais, Vaud"}))
Expand Down Expand Up @@ -813,6 +825,7 @@ def render_zh_lien(tpl: str, parts: List[str], data: Dict[str, str]) -> str:
"reverlanisation": render_modele_etym,
"siècle": render_siecle,
"siècle2": render_siecle2,
"sigle": render_sigle,
"Suisse": render_suisse,
"supplétion": render_suppletion,
"syncope": render_modele_etym,
Expand Down

0 comments on commit 76c772b

Please sign in to comment.