Skip to content

Commit

Permalink
fix BoboTiG#229: [FR] Support W template
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Nov 19, 2020
1 parent 148d115 commit 3c8e03e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/lang/fr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@
# {{variante ortho de|acupuncture|fr}}
"variante ortho de": 'f"Variante orthographique de {parts[1]}"',
"variante orthographique de": 'f"Variante orthographique de {parts[1]}"',
# {{W|Jacques Brandenberger}}
"W": "[p for p in parts if 'lang=' not in p][-1] if len(parts) > 0 else ''",
# {{wp|Sarcoscypha coccinea}}
"wp": 'italic(f"{parts[1]} sur l\'encyclopédie Wikipedia")',
# {{ws|Bible Segond 1910/Livre de Daniel|Livre de Daniel}}
Expand Down
3 changes: 3 additions & 0 deletions tests/test_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ def test_parse_word(
"{{variante orthographique de|acupuncture|fr}}",
"Variante orthographique de acupuncture",
),
("{{W|Jacques Brandenberger}}", "Jacques Brandenberger"),
("{{w|lang=en|The Little Prince}}", "The Little Prince"),
("{{w|Li Ptit Prince (roman)|Li Ptit Prince|lang=wa}}", "Li Ptit Prince"),
(
"{{wp|Sarcoscypha coccinea}}",
"<i>Sarcoscypha coccinea sur l'encyclopédie Wikipedia</i>",
Expand Down

0 comments on commit 3c8e03e

Please sign in to comment.