56 lines
2.3 KiB
Python
56 lines
2.3 KiB
Python
import unittest
|
|
|
|
from squirrelbattle.translations import gettext as _, Translator
|
|
|
|
|
|
class TestTranslations(unittest.TestCase):
|
|
def setUp(self) -> None:
|
|
Translator.setlocale("fr")
|
|
|
|
def test_main_menu_translation(self) -> None:
|
|
"""
|
|
Ensure that the main menu is translated.
|
|
"""
|
|
self.assertEqual(_("New game"), "Nouvelle partie")
|
|
self.assertEqual(_("Resume"), "Continuer")
|
|
self.assertEqual(_("Load"), "Charger")
|
|
self.assertEqual(_("Save"), "Sauvegarder")
|
|
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"),
|
|
"Touche secondaire pour aller vers le haut")
|
|
self.assertEqual(_("Main key to move down"),
|
|
"Touche principale pour aller vers le bas")
|
|
self.assertEqual(_("Secondary key to move down"),
|
|
"Touche secondaire pour aller vers le bas")
|
|
self.assertEqual(_("Main key to move left"),
|
|
"Touche principale pour aller vers la gauche")
|
|
self.assertEqual(_("Secondary key to move left"),
|
|
"Touche secondaire pour aller vers la gauche")
|
|
self.assertEqual(_("Main key to move right"),
|
|
"Touche principale pour aller vers la droite")
|
|
self.assertEqual(_("Secondary key to move right"),
|
|
"Touche secondaire pour aller vers la droite")
|
|
self.assertEqual(_("Key to validate a menu"),
|
|
"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")
|