From e3be4b4f3f62689202a627035b853be294196e3d Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 27 Nov 2020 20:32:40 +0100 Subject: [PATCH] First setup for translation --- locale/en/LC_MESSAGES/squirrelbattle.mo | Bin 0 -> 371 bytes locale/en/LC_MESSAGES/squirrelbattle.po | 22 ++++++++++++++++++++++ locale/fr/LC_MESSAGES/squirrelbattle.mo | Bin 0 -> 371 bytes locale/fr/LC_MESSAGES/squirrelbattle.po | 22 ++++++++++++++++++++++ squirrelbattle/translations.py | 15 +++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 locale/en/LC_MESSAGES/squirrelbattle.mo create mode 100644 locale/en/LC_MESSAGES/squirrelbattle.po create mode 100644 locale/fr/LC_MESSAGES/squirrelbattle.mo create mode 100644 locale/fr/LC_MESSAGES/squirrelbattle.po create mode 100644 squirrelbattle/translations.py diff --git a/locale/en/LC_MESSAGES/squirrelbattle.mo b/locale/en/LC_MESSAGES/squirrelbattle.mo new file mode 100644 index 0000000000000000000000000000000000000000..ecca9e27bf3bf4b3c848e637f5bb9cf11bef0958 GIT binary patch literal 371 zcmYL@u};G<5QYOPOGXwJ2JdhMw#pP#)3_zVPC}Yig3Yuh7!|v+T?7xp>+vjH5Td{C zlYG*D^7nn%`${nT$T4z?93VraONI21d*o;@Nfv**#W&7xy4(LWF1n=h?o}@%)oN(8dZR?JVmj|k zhC+!5+mCEsaZ^v~0=vr$|8?sJ1aQGdj<%~~0INtQ3l2OY2G%>)L!UZ?e} VJ#f2pD`Q(q22UoYNuxtdegF@5)Y literal 0 HcmV?d00001 diff --git a/locale/en/LC_MESSAGES/squirrelbattle.po b/locale/en/LC_MESSAGES/squirrelbattle.po new file mode 100644 index 0000000..85d099d --- /dev/null +++ b/locale/en/LC_MESSAGES/squirrelbattle.po @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-11-27 20:06+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: squirrelbattle/translations.py:7 +msgid "Toto" +msgstr "Test" diff --git a/locale/fr/LC_MESSAGES/squirrelbattle.mo b/locale/fr/LC_MESSAGES/squirrelbattle.mo new file mode 100644 index 0000000000000000000000000000000000000000..ecca9e27bf3bf4b3c848e637f5bb9cf11bef0958 GIT binary patch literal 371 zcmYL@u};G<5QYOPOGXwJ2JdhMw#pP#)3_zVPC}Yig3Yuh7!|v+T?7xp>+vjH5Td{C zlYG*D^7nn%`${nT$T4z?93VraONI21d*o;@Nfv**#W&7xy4(LWF1n=h?o}@%)oN(8dZR?JVmj|k zhC+!5+mCEsaZ^v~0=vr$|8?sJ1aQGdj<%~~0INtQ3l2OY2G%>)L!UZ?e} VJ#f2pD`Q(q22UoYNuxtdegF@5)Y literal 0 HcmV?d00001 diff --git a/locale/fr/LC_MESSAGES/squirrelbattle.po b/locale/fr/LC_MESSAGES/squirrelbattle.po new file mode 100644 index 0000000..85d099d --- /dev/null +++ b/locale/fr/LC_MESSAGES/squirrelbattle.po @@ -0,0 +1,22 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-11-27 20:06+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: squirrelbattle/translations.py:7 +msgid "Toto" +msgstr "Test" diff --git a/squirrelbattle/translations.py b/squirrelbattle/translations.py new file mode 100644 index 0000000..27ec288 --- /dev/null +++ b/squirrelbattle/translations.py @@ -0,0 +1,15 @@ +# Copyright (C) 2020 by ÿnérant, eichhornchen, nicomarg, charlse +# SPDX-License-Identifier: GPL-3.0-or-later + +import gettext + + +_TRANSLATORS = dict() +for language in ["en", "fr"]: + _TRANSLATORS[language] = gettext.translation("squirrelbattle", + localedir="locale", + languages=[language]) + + +def gettext(message: str) -> str: + return _TRANSLATORS.get("en", _TRANSLATORS.get("en")).gettext(message)