diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /share/templates/i18n.py | |
parent | Initial commit. (diff) | |
download | inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/templates/i18n.py')
-rwxr-xr-x | share/templates/i18n.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/share/templates/i18n.py b/share/templates/i18n.py new file mode 100755 index 0000000..96593b6 --- /dev/null +++ b/share/templates/i18n.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +from xml.dom import minidom +import sys + +elements = ["inkscape:_name", "inkscape:_shortdesc", "inkscape:_keywords"] + +sys.stdout.write("char * stringlst = [") + +for filename in sys.argv[1:]: + doc = minidom.parse(filename) + templates = doc.getElementsByTagName('inkscape:_templateinfo') + + if templates: + for element in elements: + lines = templates[0].getElementsByTagName(element) + if lines: + sys.stdout.write("N_(\"" + lines[0].firstChild.nodeValue + "\"),") + +sys.stdout.write("];") |