Skip to content

Commit

Permalink
[FR] Handle the 'Polytonique' template (capital P...) (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic authored Nov 21, 2020
1 parent 09aaa3f commit 1c13960
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/lang/fr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,10 @@ def last_template_handler(template: Tuple[str, ...], locale: str) -> str:
'μηρóς, <i>mêrós</i> («&nbsp;cuisse&nbsp;»)'
>>> last_template_handler(["polytonique", "φόβος", "phóbos", "sens=effroi, peur"], "fr")
'φόβος, <i>phóbos</i> («&nbsp;effroi, peur&nbsp;»)'
>>> last_template_handler(["Polytonique", "नामन्", "nā́man"], "fr")
'नामन्, <i>nā́man</i>'
>>> last_template_handler(["Polytonique", "هند", "hend", "Inde"], "fr")
'هند, <i>hend</i> («&nbsp;Inde&nbsp;»)'
>>> last_template_handler(["l", "dies Lunae", "la"], "fr")
'dies Lunae'
Expand Down Expand Up @@ -840,7 +844,7 @@ def last_template_handler(template: Tuple[str, ...], locale: str) -> str:
return f"*{phrase}{extension}"

# Handle the {{polytonique}} template
if tpl == "polytonique":
if tpl.lower() == "polytonique":
phrase = parts[0]
if len(parts) > 1:
phrase += f", {italic(parts[1].replace('tr=', ''))}"
Expand All @@ -849,7 +853,7 @@ def last_template_handler(template: Tuple[str, ...], locale: str) -> str:
return phrase

# Handle the {{lien}} template
if tpl == "lien" or tpl == "l":
if tpl in ["lien", "l"]:
phrase = parts[0]
for part in parts[1:]:
if part.startswith("tr="):
Expand Down

0 comments on commit 1c13960

Please sign in to comment.