-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40663 from barredterra/uom-data
- Loading branch information
Showing
10 changed files
with
430 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/setup/setup_wizard/data/uom_data.json,erpnext.gettext.extractors.uom_data.extract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import json | ||
|
||
|
||
def extract(fileobj, *args, **kwargs): | ||
""" | ||
Extract messages from a JSON file with standard UOM data. To be used by the Babel extractor. | ||
:param fileobj: the file-like object the messages should be extracted from | ||
:rtype: `iterator` | ||
""" | ||
uom_list = json.load(fileobj) | ||
|
||
if not isinstance(uom_list, list): | ||
return | ||
|
||
for uom_data in uom_list: | ||
yield None, "_", uom_data.get("uom_name"), ["Name of a UOM"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.