First setup for translation
This commit is contained in:
parent
cb18b3881f
commit
e3be4b4f3f
BIN
locale/en/LC_MESSAGES/squirrelbattle.mo
Normal file
BIN
locale/en/LC_MESSAGES/squirrelbattle.mo
Normal file
Binary file not shown.
22
locale/en/LC_MESSAGES/squirrelbattle.po
Normal file
22
locale/en/LC_MESSAGES/squirrelbattle.po
Normal file
@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\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"
|
||||
|
||||
#: squirrelbattle/translations.py:7
|
||||
msgid "Toto"
|
||||
msgstr "Test"
|
BIN
locale/fr/LC_MESSAGES/squirrelbattle.mo
Normal file
BIN
locale/fr/LC_MESSAGES/squirrelbattle.mo
Normal file
Binary file not shown.
22
locale/fr/LC_MESSAGES/squirrelbattle.po
Normal file
22
locale/fr/LC_MESSAGES/squirrelbattle.po
Normal file
@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\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"
|
||||
|
||||
#: squirrelbattle/translations.py:7
|
||||
msgid "Toto"
|
||||
msgstr "Test"
|
15
squirrelbattle/translations.py
Normal file
15
squirrelbattle/translations.py
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user