2019-04-03 03:07:38 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import os
|
|
|
|
import json
|
|
|
|
|
|
|
|
# generate fake python code containing the names and descriptions of all built-
|
|
|
|
# in fonts as gettext calls so that pybabel will extract them into messages.po
|
|
|
|
|
|
|
|
fonts_dir = os.path.join(os.path.dirname(__file__), "..", "fonts")
|
|
|
|
|
2021-02-13 11:27:23 +00:00
|
|
|
for font in sorted(os.listdir(fonts_dir)):
|
2019-04-03 03:07:38 +00:00
|
|
|
with open(os.path.join(fonts_dir, font, "font.json")) as font_json:
|
|
|
|
font_metadata = json.load(font_json)
|
|
|
|
|
2021-03-04 17:40:53 +00:00
|
|
|
print("# L10N name of font in fonts/%s" % font)
|
|
|
|
print("_(%s)" % repr(font_metadata.get("name", "")))
|
2019-04-03 03:07:38 +00:00
|
|
|
|
2021-03-04 17:40:53 +00:00
|
|
|
print("# L10N description of font in fonts/%s" % font)
|
|
|
|
print("_(%s)" % repr(font_metadata.get("description", "")))
|