2020-11-27 20:44:17 +00:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
from squirrelbattle.translations import gettext as _, setlocale
|
|
|
|
|
|
|
|
|
|
|
|
class TestTranslations(unittest.TestCase):
|
|
|
|
def setUp(self) -> None:
|
|
|
|
setlocale("fr")
|
|
|
|
|
2020-11-27 20:56:25 +00:00
|
|
|
def test_translations(self) -> None:
|
2020-11-27 20:44:17 +00:00
|
|
|
"""
|
|
|
|
Ensure that some strings are well-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")
|
2020-11-27 21:19:41 +00:00
|
|
|
|
|
|
|
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")
|