Translate entities

This commit is contained in:
Yohann D'ANELLO
2020-11-27 22:33:58 +01:00
parent 8f85093eb8
commit 70ae60b9a4
5 changed files with 113 additions and 14 deletions

View File

@ -7,9 +7,9 @@ class TestTranslations(unittest.TestCase):
def setUp(self) -> None:
setlocale("fr")
def test_translations(self) -> None:
def test_main_menu_translation(self) -> None:
"""
Ensure that some strings are well-translated.
Ensure that the main menu is translated.
"""
self.assertEqual(_("New game"), "Nouvelle partie")
self.assertEqual(_("Resume"), "Continuer")
@ -18,6 +18,10 @@ class TestTranslations(unittest.TestCase):
self.assertEqual(_("Settings"), "Paramètres")
self.assertEqual(_("Exit"), "Quitter")
def test_settings_menu_translation(self) -> None:
"""
Ensure that the settings menu is translated.
"""
self.assertEqual(_("Main key to move up"),
"Touche principale pour aller vers le haut")
self.assertEqual(_("Secondary key to move up"),
@ -38,3 +42,14 @@ class TestTranslations(unittest.TestCase):
"Touche pour valider un menu")
self.assertEqual(_("Texture pack"), "Pack de textures")
self.assertEqual(_("Language"), "Langue")
def test_entities_translation(self) -> None:
self.assertEqual(_("player"), "joueur")
self.assertEqual(_("tiger"), "tigre")
self.assertEqual(_("hedgehog"), "hérisson")
self.assertEqual(_("rabbit"), "lapin")
self.assertEqual(_("teddy bear"), "nounours")
self.assertEqual(_("bomb"), "bombe")
self.assertEqual(_("heart"), "cœur")