Fix translations
Some checks failed
Gitea/kapitanbooru-uploader/pipeline/head There was a failure building this commit
Some checks failed
Gitea/kapitanbooru-uploader/pipeline/head There was a failure building this commit
This commit is contained in:
@ -1,16 +1,14 @@
|
||||
import gettext
|
||||
import locale
|
||||
import os
|
||||
from typing import Dict
|
||||
|
||||
from importlib.resources import files
|
||||
|
||||
class I18N:
|
||||
def __init__(self, locale_dir=None):
|
||||
# If no locale_dir is provided, use the locales folder relative to this file.
|
||||
if locale_dir is None:
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
locale_dir = os.path.join(current_dir, "locales")
|
||||
self.locale_dir = locale_dir
|
||||
locale_dir = files("kapitanbooru_uploader").joinpath("locales")
|
||||
self.locale_dir = str(locale_dir)
|
||||
self.languages = {"en": "English", "pl": "Polski"}
|
||||
self.current_lang = "en"
|
||||
self.translations: Dict[str, str] = {}
|
||||
|
Reference in New Issue
Block a user