Files
crystall-punk-14/Tools/_CP14/LocalizationHelper/fluent/ftl_writer.py
comasqw fa86f705aa Localization Helper (#275)
* Localization Helper

* Update main.py

* Update main.py

* adding comments to code and translating exceptions into English

* cringe fix

* Update yml_parser.py

* tweak

* Update main.py
2024-06-25 18:02:02 +03:00

18 lines
347 B
Python

import json
def create_ftl(key: str, prototype: dict) -> str:
ftl = ""
ftl += f"ent-{key} = {prototype["name"]}\n"
if prototype["desc"] is not None:
ftl += f" .desc = {prototype["desc"]}\n"
if prototype["suffix"] is not None:
ftl += f" .suffix = {prototype["suffix"]}\n"
ftl += "\n"
return ftl