* local helper update
* Delete entities.ftl
* Helper Refactor
* Revert "Helper Refactor"
This reverts commit 4aca315593.
* Helper Refactor
* Жееесть, я не знал про setdefault у словарей
* Update localization_helper.py
* Ревёрт "Жееесть, я не знал про setdefault у словарей"
Лучше бы я продолжал не знать о них
* чтооооо
* Update yml_parser.py
* Update entities.ftl
---------
Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
27 lines
779 B
Python
27 lines
779 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
|