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 57144d5
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 @@ -527,6 +527,8 @@
"wsp": "parts[2] if len(parts) > 2 else parts[1]",
# {{WSP|Panthera leo}}
"WSP": "term(parts[1])",
# {{W|Jacques Brandenberger}}
"W": "[p for p in parts if 'lang=' not in p][-1] if len(parts) > 0 else ''",
}

# Modèles qui seront remplacés par du texte personnalisé.
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 57144d5

Please sign in to comment.