Some translations were missing concerning sunflowers, fixes #44
This commit is contained in:
parent
73e1fac89a
commit
288a6ac2c9
@ -155,7 +155,7 @@ class PlayerInventoryDisplay(MenuDisplay):
|
||||
"""
|
||||
We can select a menu item with the mouse.
|
||||
"""
|
||||
self.menu.position = max(0, min(len(self.menu.values) - 1, y - 3))
|
||||
self.menu.position = max(0, min(len(self.menu.values) - 1, y - 2))
|
||||
game.handle_key_pressed(KeyValues.ENTER)
|
||||
|
||||
|
||||
@ -181,5 +181,5 @@ class StoreInventoryDisplay(MenuDisplay):
|
||||
"""
|
||||
We can select a menu item with the mouse.
|
||||
"""
|
||||
self.menu.position = max(0, min(len(self.menu.values) - 1, y - 3))
|
||||
self.menu.position = max(0, min(len(self.menu.values) - 1, y - 2))
|
||||
game.handle_key_pressed(KeyValues.ENTER)
|
||||
|
@ -43,8 +43,10 @@ class Sunflower(FriendlyEntity):
|
||||
"""
|
||||
A friendly sunflower
|
||||
"""
|
||||
dialogue_option = [_("Flower power!!"), _("The sun is warm today")]
|
||||
|
||||
def __init__(self, maxhealth: int = 15,
|
||||
*args, **kwargs) -> None:
|
||||
super().__init__(name="sunflower", maxhealth=maxhealth, *args, **kwargs)
|
||||
|
||||
@property
|
||||
def dialogue_option(self):
|
||||
return [_("Flower power!!"), _("The sun is warm today")]
|
||||
|
@ -474,9 +474,9 @@ class FriendlyEntity(FightingEntity):
|
||||
dialogue_option: list
|
||||
|
||||
def talk_to(self, player: Any) -> str:
|
||||
a = randint(0, len(self.dialogue_option) - 1)
|
||||
return "The " + self.translated_name \
|
||||
+ " said : " + self.dialogue_option[a]
|
||||
return _("{entity} said: {message}").format(
|
||||
entity=self.translated_name.capitalize(),
|
||||
message=choice(self.dialogue_option))
|
||||
|
||||
def keys(self) -> list:
|
||||
"""
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: squirrelbattle 3.14.1\n"
|
||||
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
|
||||
"POT-Creation-Date: 2020-12-12 17:07+0100\n"
|
||||
"POT-Creation-Date: 2020-12-12 17:24+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -38,11 +38,11 @@ msgstr "SIE WURDEN GESTORBEN"
|
||||
msgid "I don't sell any squirrel"
|
||||
msgstr "Ich verkaufe keinen Eichhörnchen."
|
||||
|
||||
#: squirrelbattle/entities/friendly.py:46
|
||||
#: squirrelbattle/entities/friendly.py:52
|
||||
msgid "Flower power!!"
|
||||
msgstr "Blumenmacht!!"
|
||||
|
||||
#: squirrelbattle/entities/friendly.py:46
|
||||
#: squirrelbattle/entities/friendly.py:52
|
||||
msgid "The sun is warm today"
|
||||
msgstr "Die Sonne ist warm heute"
|
||||
|
||||
@ -101,6 +101,11 @@ msgstr "{name} nimmt {amount} Schadenspunkte."
|
||||
msgid "{name} dies."
|
||||
msgstr "{name} stirbt."
|
||||
|
||||
#: squirrelbattle/interfaces.py:477
|
||||
#, python-brace-format
|
||||
msgid "{entity} said: {message}"
|
||||
msgstr "{entity} hat gesagt: {message}"
|
||||
|
||||
#: squirrelbattle/menus.py:73
|
||||
msgid "Back"
|
||||
msgstr "Zurück"
|
||||
@ -200,33 +205,45 @@ msgid "player"
|
||||
msgstr "Spieler"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:61
|
||||
msgid "tiger"
|
||||
msgstr "Tiger"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:62
|
||||
msgid "hedgehog"
|
||||
msgstr "Igel"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:62
|
||||
msgid "merchant"
|
||||
msgstr "Kaufmann"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:63
|
||||
msgid "rabbit"
|
||||
msgstr "Kanninchen"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:64
|
||||
msgid "sunflower"
|
||||
msgstr "Sonnenblume"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:65
|
||||
msgid "teddy bear"
|
||||
msgstr "Teddybär"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:66
|
||||
msgid "tiger"
|
||||
msgstr "Tiger"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:68
|
||||
msgid "body snatch potion"
|
||||
msgstr "Leichenfleddererzaubertrank"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:67
|
||||
#: squirrelbattle/tests/translations_test.py:69
|
||||
msgid "bomb"
|
||||
msgstr "Bombe"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:68
|
||||
#: squirrelbattle/tests/translations_test.py:70
|
||||
msgid "explosion"
|
||||
msgstr "Explosion"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:71
|
||||
msgid "heart"
|
||||
msgstr "Herz"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:69
|
||||
#: squirrelbattle/tests/translations_test.py:72
|
||||
msgid "sword"
|
||||
msgstr "schwert"
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: squirrelbattle 3.14.1\n"
|
||||
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
|
||||
"POT-Creation-Date: 2020-12-12 17:07+0100\n"
|
||||
"POT-Creation-Date: 2020-12-12 17:24+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -37,11 +37,11 @@ msgstr "ERES MUERTO"
|
||||
msgid "I don't sell any squirrel"
|
||||
msgstr "No vendo ninguna ardilla"
|
||||
|
||||
#: squirrelbattle/entities/friendly.py:46
|
||||
#: squirrelbattle/entities/friendly.py:52
|
||||
msgid "Flower power!!"
|
||||
msgstr "Poder de las flores!!"
|
||||
|
||||
#: squirrelbattle/entities/friendly.py:46
|
||||
#: squirrelbattle/entities/friendly.py:52
|
||||
msgid "The sun is warm today"
|
||||
msgstr "El sol está caliente hoy"
|
||||
|
||||
@ -100,6 +100,11 @@ msgstr "{name} recibe {amount} daño."
|
||||
msgid "{name} dies."
|
||||
msgstr "{name} se muere."
|
||||
|
||||
#: squirrelbattle/interfaces.py:477
|
||||
#, python-brace-format
|
||||
msgid "{entity} said: {message}"
|
||||
msgstr "{entity} dijo : {message}"
|
||||
|
||||
#: squirrelbattle/menus.py:73
|
||||
msgid "Back"
|
||||
msgstr "Volver"
|
||||
@ -199,33 +204,45 @@ msgid "player"
|
||||
msgstr "jugador"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:61
|
||||
msgid "tiger"
|
||||
msgstr "tigre"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:62
|
||||
msgid "hedgehog"
|
||||
msgstr "erizo"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:62
|
||||
msgid "merchant"
|
||||
msgstr "comerciante"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:63
|
||||
msgid "rabbit"
|
||||
msgstr "conejo"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:64
|
||||
msgid "sunflower"
|
||||
msgstr "girasol"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:65
|
||||
msgid "teddy bear"
|
||||
msgstr "osito de peluche"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:66
|
||||
msgid "tiger"
|
||||
msgstr "tigre"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:68
|
||||
msgid "body snatch potion"
|
||||
msgstr "poción de intercambio"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:67
|
||||
#: squirrelbattle/tests/translations_test.py:69
|
||||
msgid "bomb"
|
||||
msgstr "bomba"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:68
|
||||
#: squirrelbattle/tests/translations_test.py:70
|
||||
msgid "explosion"
|
||||
msgstr "explosión"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:71
|
||||
msgid "heart"
|
||||
msgstr "corazón"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:69
|
||||
#: squirrelbattle/tests/translations_test.py:72
|
||||
msgid "sword"
|
||||
msgstr "espada"
|
||||
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: squirrelbattle 3.14.1\n"
|
||||
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
|
||||
"POT-Creation-Date: 2020-12-12 17:07+0100\n"
|
||||
"POT-Creation-Date: 2020-12-12 17:24+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -38,11 +38,11 @@ msgstr "VOUS ÊTES MORT"
|
||||
msgid "I don't sell any squirrel"
|
||||
msgstr "Je ne vends pas d'écureuil"
|
||||
|
||||
#: squirrelbattle/entities/friendly.py:46
|
||||
#: squirrelbattle/entities/friendly.py:52
|
||||
msgid "Flower power!!"
|
||||
msgstr "Pouvoir des fleurs !"
|
||||
msgstr "Pouvoir des fleurs !!"
|
||||
|
||||
#: squirrelbattle/entities/friendly.py:46
|
||||
#: squirrelbattle/entities/friendly.py:52
|
||||
msgid "The sun is warm today"
|
||||
msgstr "Le soleil est chaud aujourd'hui"
|
||||
|
||||
@ -101,6 +101,11 @@ msgstr "{name} prend {amount} points de dégât."
|
||||
msgid "{name} dies."
|
||||
msgstr "{name} meurt."
|
||||
|
||||
#: squirrelbattle/interfaces.py:477
|
||||
#, python-brace-format
|
||||
msgid "{entity} said: {message}"
|
||||
msgstr "{entity} a dit : {message}"
|
||||
|
||||
#: squirrelbattle/menus.py:73
|
||||
msgid "Back"
|
||||
msgstr "Retour"
|
||||
@ -200,33 +205,45 @@ msgid "player"
|
||||
msgstr "joueur"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:61
|
||||
msgid "tiger"
|
||||
msgstr "tigre"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:62
|
||||
msgid "hedgehog"
|
||||
msgstr "hérisson"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:62
|
||||
msgid "merchant"
|
||||
msgstr "marchand"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:63
|
||||
msgid "rabbit"
|
||||
msgstr "lapin"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:64
|
||||
msgid "sunflower"
|
||||
msgstr "tournesol"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:65
|
||||
msgid "teddy bear"
|
||||
msgstr "nounours"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:66
|
||||
msgid "tiger"
|
||||
msgstr "tigre"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:68
|
||||
msgid "body snatch potion"
|
||||
msgstr "potion d'arrachage de corps"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:67
|
||||
#: squirrelbattle/tests/translations_test.py:69
|
||||
msgid "bomb"
|
||||
msgstr "bombe"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:68
|
||||
#: squirrelbattle/tests/translations_test.py:70
|
||||
msgid "explosion"
|
||||
msgstr ""
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:71
|
||||
msgid "heart"
|
||||
msgstr "cœur"
|
||||
|
||||
#: squirrelbattle/tests/translations_test.py:69
|
||||
#: squirrelbattle/tests/translations_test.py:72
|
||||
msgid "sword"
|
||||
msgstr "épée"
|
||||
|
@ -496,8 +496,8 @@ class TestGame(unittest.TestCase):
|
||||
self.assertEqual(self.game.state, GameMode.PLAY)
|
||||
self.assertTrue(self.game.logs.messages)
|
||||
# Ensure that the message is a good message
|
||||
self.assertIn(self.game.logs.messages[1][21:],
|
||||
Sunflower.dialogue_option)
|
||||
self.assertIn(self.game.logs.messages[1][16:],
|
||||
Sunflower().dialogue_option)
|
||||
|
||||
# Test all directions to detect the friendly entity
|
||||
self.game.player.move(3, 6)
|
||||
@ -547,7 +547,7 @@ class TestGame(unittest.TestCase):
|
||||
# Buy the second item by clicking on it
|
||||
item = self.game.store_menu.validate()
|
||||
self.assertIn(item, merchant.inventory)
|
||||
self.game.display_actions(DisplayActions.MOUSE, 8, 25)
|
||||
self.game.display_actions(DisplayActions.MOUSE, 7, 25)
|
||||
self.game.handle_key_pressed(KeyValues.ENTER)
|
||||
self.assertIn(item, self.game.player.inventory)
|
||||
self.assertNotIn(item, merchant.inventory)
|
||||
|
@ -58,12 +58,15 @@ class TestTranslations(unittest.TestCase):
|
||||
def test_entities_translation(self) -> None:
|
||||
self.assertEqual(_("player"), "joueur")
|
||||
|
||||
self.assertEqual(_("tiger"), "tigre")
|
||||
self.assertEqual(_("hedgehog"), "hérisson")
|
||||
self.assertEqual(_("merchant"), "marchand")
|
||||
self.assertEqual(_("rabbit"), "lapin")
|
||||
self.assertEqual(_("sunflower"), "tournesol")
|
||||
self.assertEqual(_("teddy bear"), "nounours")
|
||||
self.assertEqual(_("tiger"), "tigre")
|
||||
|
||||
self.assertEqual(_("body snatch potion"), "potion d'arrachage de corps")
|
||||
self.assertEqual(_("bomb"), "bombe")
|
||||
self.assertEqual(_("explosion"), "explosion")
|
||||
self.assertEqual(_("heart"), "cœur")
|
||||
self.assertEqual(_("sword"), "épée")
|
||||
|
Loading…
Reference in New Issue
Block a user