feat: add extractor for setup wizard txt files
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
**/setup/setup_wizard/data/uom_data.json,erpnext.gettext.extractors.uom_data.extract
|
**/setup/setup_wizard/data/uom_data.json,erpnext.gettext.extractors.uom_data.extract
|
||||||
**/setup/doctype/incoterm/incoterms.csv,erpnext.gettext.extractors.incoterms.extract
|
**/setup/doctype/incoterm/incoterms.csv,erpnext.gettext.extractors.incoterms.extract
|
||||||
|
**/setup/setup_wizard/data/*.txt,erpnext.gettext.extractors.lines_from_txt_file.extract
|
||||||
|
|||||||
|
4
erpnext/gettext/extractors/lines_from_txt_file.py
Normal file
4
erpnext/gettext/extractors/lines_from_txt_file.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
def extract(fileobj, *args, **kwargs):
|
||||||
|
"""Split file into lines and yield one translation unit per line."""
|
||||||
|
for line_no, line in enumerate(fileobj.readlines()):
|
||||||
|
yield line_no + 1, "_", line.decode().strip(), []
|
||||||
Reference in New Issue
Block a user