mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-03 11:18:26 +02:00
14 lines
376 B
Python
14 lines
376 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
|
|
language_data = json.loads(Path("./assets/language/en.json").read_text(encoding="utf8"))
|
|
|
|
|
|
def translate(*text) -> str:
|
|
"""
|
|
Translate a text to the loaded language.
|
|
:param text: list of text to translate
|
|
:return: translated text
|
|
"""
|
|
return "".join([language_data["translation"].get(word, word) for word in text])
|