* feat: add desktop icon extractor * feat: add workspace sidebar extractor * feat: add desktop icon extractor * fix: resolve merge conflict in babel_extractors.csv * docs: fix typo in docstring --------- Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
18 lines
466 B
Python
18 lines
466 B
Python
import json
|
|
|
|
|
|
def extract(fileobj, *args, **kwargs):
|
|
"""Extract messages from Desktop Icon JSON files. To be used by babel extractor.
|
|
|
|
:param fileobj: the file-like object the messages should be extracted from
|
|
:rtype: `iterator`
|
|
"""
|
|
data = json.load(fileobj)
|
|
|
|
if isinstance(data, list):
|
|
return
|
|
|
|
# Extract the label field (main translatable field for Desktop Icons)
|
|
label = data.get("label")
|
|
if label:
|
|
yield None, "_", label, ["Label of a Desktop Icon"]
|