fix: extract incoterm titles as translatable strings
This commit is contained in:
@@ -1 +1,2 @@
|
||||
**/setup/setup_wizard/data/uom_data.json,erpnext.gettext.extractors.uom_data.extract
|
||||
**/setup/doctype/incoterm/incoterms.csv,erpnext.gettext.extractors.incoterms.extract
|
||||
|
||||
|
10
erpnext/gettext/extractors/incoterms.py
Normal file
10
erpnext/gettext/extractors/incoterms.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from csv import DictReader
|
||||
from io import StringIO
|
||||
|
||||
|
||||
def extract(fileobj, *args, **kwargs):
|
||||
"""Extract incoterm titles from a CSV file."""
|
||||
file = StringIO(fileobj.read().decode()) # CSV reader expects a text file
|
||||
reader = DictReader(file)
|
||||
for i, row in enumerate(reader):
|
||||
yield i + 2, "_", row["title"], ["Title of an incoterm"]
|
||||
Reference in New Issue
Block a user