version 0.1
This commit is contained in:
51
src/anki_hsk_creator/constants.py
Normal file
51
src/anki_hsk_creator/constants.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""constants.py"""
|
||||
|
||||
# Standard Library
|
||||
import importlib.resources
|
||||
|
||||
# Local
|
||||
from . import DATA_FOLDER
|
||||
|
||||
# Resources
|
||||
CCCEDICT_PATH = importlib.resources.files("anki-hsk-creator").joinpath("cedict_ts.u8")
|
||||
|
||||
# Data folder structure
|
||||
INPUT = DATA_FOLDER / "input"
|
||||
INPUT.mkdir(exist_ok=True, parents=True)
|
||||
OUTPUT = DATA_FOLDER / "output"
|
||||
OUTPUT.mkdir(exist_ok=True, parents=True)
|
||||
RESOURCES = DATA_FOLDER / "resources"
|
||||
RESOURCES.mkdir(exist_ok=True, parents=True)
|
||||
|
||||
# File Types
|
||||
PHRASES_TYPE = ".phrases"
|
||||
DICT_TYPE = ".dictionary"
|
||||
|
||||
|
||||
class LANGUAGES:
|
||||
"""Available laguages for translation"""
|
||||
|
||||
CN = "zh"
|
||||
EN = "en"
|
||||
ES = "es"
|
||||
FR = "fr"
|
||||
RU = "ru"
|
||||
TR = "tr"
|
||||
TH = "th"
|
||||
|
||||
@property
|
||||
def available_languages(self) -> tuple:
|
||||
"""Available laguages for translation"""
|
||||
return (self.EN, self.ES, self.FR, self.RU, self.TR, self.TH)
|
||||
|
||||
@property
|
||||
def language_names(self) -> dict:
|
||||
"""Gets the name of a language code"""
|
||||
return {
|
||||
self.EN: "English",
|
||||
self.ES: "Spanish",
|
||||
self.FR: "French",
|
||||
self.RU: "Russian",
|
||||
self.TR: "Turkish",
|
||||
self.TH: "Thai",
|
||||
}
|
||||
Reference in New Issue
Block a user