First setup for translation
This commit is contained in:
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)
|
Reference in New Issue
Block a user