Add spanish translation

This commit is contained in:
Yohann D'ANELLO 2020-12-07 01:01:39 +01:00
parent 6fa11d9dfe
commit fdc2bcab8d
8 changed files with 218 additions and 11 deletions

View File

@ -35,7 +35,7 @@ paquet ainsi que des détails à fournir à PyPI :
long_description = f.read()
# Compile messages
for language in ["de", "en", "fr"]:
for language in ["de", "es", "fr"]:
args = ["msgfmt", "--check-format",
"-o", f"squirrelbattle/locale/{language}/LC_MESSAGES"
"/squirrelbattle.mo",

View File

@ -11,7 +11,7 @@ with open("README.md", "r") as f:
long_description = f.read()
# Compile messages
for language in ["de", "fr"]:
for language in ["de", "es", "fr"]:
args = ["msgfmt", "--check-format",
"-o", f"squirrelbattle/locale/{language}/LC_MESSAGES"
"/squirrelbattle.mo",

View File

@ -1,9 +1,7 @@
# SOME DESCRIPTIVE TITLE.
# German translation of Squirrel Battle
# Copyright (C) YEAR ÿnérant, eichhornchen, nicomarg, charlse
# This file is distributed under the same license as the squirrelbattle package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\n"

View File

@ -0,0 +1,206 @@
# Spanish translation of Squirrel Battle
# Copyright (C) YEAR ÿnérant, eichhornchen, nicomarg, charlse
# This file is distributed under the same license as the squirrelbattle package.
# Translation by ifugaao
#
msgid ""
msgstr ""
"Project-Id-Version: squirrelbattle 3.14.1\n"
"Report-Msgid-Bugs-To: squirrel-battle@crans.org\n"
"POT-Creation-Date: 2020-12-05 14:46+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ifugao\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
# Suggested in Weblate: == INVENTORIO ==
#: squirrelbattle/display/menudisplay.py:105
msgid "== INVENTORY =="
msgstr "== INVENTORIO =="
# Suggested in Weblate: Inventorio :
#: squirrelbattle/display/statsdisplay.py:34
msgid "Inventory:"
msgstr "Inventorio :"
# Suggested in Weblate: ERES MUERTO
#: squirrelbattle/display/statsdisplay.py:50
msgid "YOU ARE DEAD"
msgstr "ERES MUERTO"
#. The bomb is exploding.
#. Each entity that is close to the bomb takes damages.
#. The player earn XP if the entity was killed.
#: squirrelbattle/entities/items.py:128
msgid "Bomb is exploding."
msgstr "La bomba está explotando."
#: squirrelbattle/entities/items.py:172
#, python-brace-format
msgid "{player} exchanged its body with {entity}."
msgstr "{player} intercambió su cuerpo con {entity}."
#: squirrelbattle/game.py:177
msgid ""
"Some keys are missing in your save file.\n"
"Your save seems to be corrupt. It got deleted."
msgstr ""
"Algunas claves faltan en su archivo de guarda.\n"
"Su guarda parece a ser corruptido. Fue eliminado."
#: squirrelbattle/game.py:185
msgid ""
"No player was found on this map!\n"
"Maybe you died?"
msgstr ""
"No jugador encontrado sobre la carta !\n"
"¿ Quizas murió ?"
#: squirrelbattle/game.py:205
msgid ""
"The JSON file is not correct.\n"
"Your save seems corrupted. It got deleted."
msgstr ""
"El JSON archivo no es correcto.\n"
"Su guarda parece corrupta. Fue eliminada."
#: squirrelbattle/interfaces.py:400
#, python-brace-format
msgid "{name} hits {opponent}."
msgstr "{name} golpea a {opponent}."
#: squirrelbattle/interfaces.py:412
#, python-brace-format
msgid "{name} takes {amount} damage."
msgstr "{name} recibe {amount} daño."
#: squirrelbattle/interfaces.py:414
#, python-brace-format
msgid "{name} dies."
msgstr "{name} se muere."
#: squirrelbattle/menus.py:72
msgid "Back"
msgstr "Volver"
#: squirrelbattle/tests/game_test.py:300,
#: squirrelbattle/tests/game_test.py:303,
#: squirrelbattle/tests/game_test.py:306,
#: squirrelbattle/tests/translations_test.py:16
msgid "New game"
msgstr "Nuevo partido"
#: squirrelbattle/tests/translations_test.py:17
msgid "Resume"
msgstr "Resumir"
#: squirrelbattle/tests/translations_test.py:18
msgid "Load"
msgstr "Cargar"
#: squirrelbattle/tests/translations_test.py:19
msgid "Save"
msgstr "Guardar"
#: squirrelbattle/tests/translations_test.py:20
msgid "Settings"
msgstr "Parametros"
#: squirrelbattle/tests/translations_test.py:21
msgid "Exit"
msgstr "Salir"
#: squirrelbattle/tests/translations_test.py:27
msgid "Main key to move up"
msgstr "Primera tecla para subir"
#: squirrelbattle/tests/translations_test.py:29
msgid "Secondary key to move up"
msgstr "Segunda tecla para subir"
#: squirrelbattle/tests/translations_test.py:31
msgid "Main key to move down"
msgstr "Primera tecla para bajar"
#: squirrelbattle/tests/translations_test.py:33
msgid "Secondary key to move down"
msgstr "Segunda tecla para bajar"
#: squirrelbattle/tests/translations_test.py:35
msgid "Main key to move left"
msgstr "Primera tecla para moverse a la izquierda"
#: squirrelbattle/tests/translations_test.py:37
msgid "Secondary key to move left"
msgstr "Segunda tecla para moverse a la izquierda"
#: squirrelbattle/tests/translations_test.py:39
msgid "Main key to move right"
msgstr "Primera tecla para moverse a la derecha"
#: squirrelbattle/tests/translations_test.py:41
msgid "Secondary key to move right"
msgstr "Segunda tecla para moverse a la derecha"
#: squirrelbattle/tests/translations_test.py:43
msgid "Key to validate a menu"
msgstr "Tecla para validar un menú"
#: squirrelbattle/tests/translations_test.py:45
msgid "Key used to open the inventory"
msgstr "Tecla para abrir el inventorio"
#: squirrelbattle/tests/translations_test.py:47
msgid "Key used to use an item in the inventory"
msgstr "Tecla para utilizar un objeto del inventorio"
#: squirrelbattle/tests/translations_test.py:49
msgid "Key used to equip an item in the inventory"
msgstr "Tecla para equipar un objeto del inventorio"
#: squirrelbattle/tests/translations_test.py:51
msgid "Key used to drop an item in the inventory"
msgstr "Tecla para dejar un objeto del inventorio"
#: squirrelbattle/tests/translations_test.py:53
msgid "Texture pack"
msgstr "Paquete de texturas"
#: squirrelbattle/tests/translations_test.py:54
msgid "Language"
msgstr "Languaje"
#: squirrelbattle/tests/translations_test.py:57
msgid "player"
msgstr "jugador"
#: squirrelbattle/tests/translations_test.py:59
msgid "tiger"
msgstr "tigre"
#: squirrelbattle/tests/translations_test.py:60
msgid "hedgehog"
msgstr "erizo"
#: squirrelbattle/tests/translations_test.py:61
msgid "rabbit"
msgstr "conejo"
#: squirrelbattle/tests/translations_test.py:62
msgid "teddy bear"
msgstr "osito de peluche"
#: squirrelbattle/tests/translations_test.py:64
msgid "body snatch potion"
msgstr "poción de intercambio"
#: squirrelbattle/tests/translations_test.py:65
msgid "bomb"
msgstr "bomba"
#: squirrelbattle/tests/translations_test.py:66
msgid "heart"
msgstr "corazón"

View File

@ -1,7 +1,6 @@
# SOME DESCRIPTIVE TITLE.
# French translation of Squirrel Battle
# Copyright (C) YEAR ÿnérant, eichhornchen, nicomarg, charlse
# This file is distributed under the same license as the squirrelbattle package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
@ -12,7 +11,7 @@ msgstr ""
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

View File

@ -99,7 +99,8 @@ class SettingsMenu(Menu):
self.update_values(game.settings)
elif option == "LOCALE":
game.settings.LOCALE = 'fr' if game.settings.LOCALE == 'en'\
else 'de' if game.settings.LOCALE == 'fr' else 'en'
else 'de' if game.settings.LOCALE == 'fr' else 'es' \
if game.settings.LOCALE == 'de' else 'en'
Translator.setlocale(game.settings.LOCALE)
game.settings.write_settings()
self.update_values(game.settings)

View File

@ -302,6 +302,9 @@ class TestGame(unittest.TestCase):
self.assertEqual(self.game.settings.LOCALE, "de")
self.assertEqual(_("New game"), "Neu Spiel")
self.game.handle_key_pressed(KeyValues.ENTER)
self.assertEqual(self.game.settings.LOCALE, "es")
self.assertEqual(_("New game"), "Nuevo partido")
self.game.handle_key_pressed(KeyValues.ENTER)
self.assertEqual(self.game.settings.LOCALE, "en")
self.assertEqual(_("New game"), "New game")

View File

@ -15,7 +15,7 @@ class Translator:
Translator.setlocale defines the language of the strings,
then gettext() translates the message.
"""
SUPPORTED_LOCALES: List[str] = ["de", "en", "fr"]
SUPPORTED_LOCALES: List[str] = ["de", "en", "es", "fr"]
locale: str = "en"
translators: dict = {}
@ -67,7 +67,7 @@ class Translator:
"--package-name=squirrelbattle",
"--package-version=3.14.1",
"--copyright-holder=ÿnérant, eichhornchen, "
"nicomarg, charlse",
"nicomarg, charlse, ifugao",
"--msgid-bugs-address=squirrel-battle@crans.org",
"--sort-by-file",
"-o", file_name]