diff --git a/output/heron/014.svg b/output/heron/014.svg index 7bc4ab1..b28a7da 100644 --- a/output/heron/014.svg +++ b/output/heron/014.svg @@ -22,7 +22,7 @@ 6 -Piochez une carte. +Piochez deux cartes. diff --git a/output/heron/062.svg b/output/heron/062.svg index 4928a86..222dc3b 100644 --- a/output/heron/062.svg +++ b/output/heron/062.svg @@ -30,7 +30,7 @@ 5 -Piochez une carte. +Piochez deux cartes. diff --git a/src/card_types.py b/src/card_types.py index c5efcbb..584973c 100644 --- a/src/card_types.py +++ b/src/card_types.py @@ -6,6 +6,7 @@ from typing import TypedDict class Translation(TypedDict): card_type: dict[str, str] effects: dict[str, str] + numbers: dict[str, str] @dataclass diff --git a/src/data/translation_fr.json b/src/data/translation_fr.json index 25e33d1..8b34d0f 100644 --- a/src/data/translation_fr.json +++ b/src/data/translation_fr.json @@ -3,8 +3,13 @@ "action":"Action", "champion":"Champion" }, + "numbers":{ + "1": "une", + "2": "deux" + }, "effects":{ "draw":"Piochez une carte.", + "draw_n":"Piochez %a cartes.", "stun":"Assomez le champion ciblé.", "stack_next_card_bought":"Mettez la prochaine carte dont vous faites l'acquisition\nau dessus de votre pioche.", "sacrifice":"Vous pouvez sacrifier une carte de votre main ou de votre défausse.", diff --git a/src/draw_functions.py b/src/draw_functions.py index e5337bc..5e1df93 100644 --- a/src/draw_functions.py +++ b/src/draw_functions.py @@ -202,9 +202,21 @@ def create_effect_row(effects: list[Effect], type: str, height: int, width: int) for e in effect_with_text: if effect_text != "": effect_text += " " - translation = translation_fr.get("effects").get( - e.get("effect"), e.get("effect") - ) + + if e.get("amount", 1) > 1: + + translation = ( + translation_fr.get("effects") + .get(e.get("effect") + "_n", e.get("effect")) + .replace( + "%a", + str(translation_fr.get("numbers").get(str(e.get("amount", "")))), + ) + ) + else: + translation = translation_fr.get("effects").get( + e.get("effect"), e.get("effect") + ) effect_text += translation group.append(