diff --git a/locale/en/LC_MESSAGES/squirrelbattle.mo b/locale/en/LC_MESSAGES/squirrelbattle.mo new file mode 100644 index 0000000..ecca9e2 Binary files /dev/null and b/locale/en/LC_MESSAGES/squirrelbattle.mo differ 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 0000000..ecca9e2 Binary files /dev/null and b/locale/fr/LC_MESSAGES/squirrelbattle.mo differ 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)