Skip to content

Commit

Permalink
[FR] Support the 'Légifrance' template (closes #339)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic authored Nov 23, 2020
1 parent 5cea231 commit 51dd3e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/lang/fr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,11 @@ def last_template_handler(
>>> last_template_handler(["la-verb", "sum", "es", "esse", "esse", "fui", "fui", "futurus", "futurus", "2ps=es", "2ps2=es", "pattern=irrégulier", "44=participe futur"], "fr")
'<b>sum</b>, es, <i>infinitif</i> : esse, <i>parfait</i> : fui, <i>participe futur</i> : futurus <i>(irrégulier)</i>'
>>> last_template_handler(["Légifrance", "base=CPP", "numéro=230-45", "texte=article 230-45"], "fr")
'article 230-45'
>>> last_template_handler(["Légifrance", "base=CPP", "numéro=230-45"], "fr")
''
>>> last_template_handler(["l", "dies Lunae", "la"], "fr")
'dies Lunae'
>>> last_template_handler(["lien", "渦", "zh-Hans"], "fr")
Expand Down Expand Up @@ -1090,6 +1095,9 @@ def last_template_handler(
phrase += " " + italic(f"({data['pattern']})")
return phrase

if tpl == "Légifrance":
return data["texte"]

if tpl in ("lien", "l"):
phrase = parts.pop(0)
if data["tr"]:
Expand Down

0 comments on commit 51dd3e5

Please sign in to comment.