Files
comasqw b592842a66 fix localization helper & protos descriptions in ftl (#282)
* fix localization helper & protos descriptions in ftl

* Update main.py

* Update objects.ftl

* добавил ярлык напрямую к файлу локализации

* megasuperduperpuperTWEAK

* Update yml_parser.py

* Update yml_parser.py

* Update yml_parser.py

* Update yml_parser.py

* Update main.py

* tweak

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
Co-authored-by: Ed <edwardxperia2000@gmail.com>
2024-06-27 22:07:25 +03:00

27 lines
777 B
Python

from fluent import ftl_reader
from base_parser import BaseParser
class FTLParser(BaseParser):
"""
The class inherits from the "BaseParser" class, parses ftl files of localization.
"""
def ftl_parser(self) -> dict:
"""
The function gets the path, then with the help of the os library
goes through each file,checks that the file extension is "ftl",
then reads it through the "ftl_reader" module of the "fluent" package.
"""
prototypes = {}
for path in self.get_files_paths():
if not self.check_file_extension(path, ".ftl"):
continue
file = ftl_reader.read_ftl((path, self.errors_path))
prototypes.update(file)
return prototypes