summaryrefslogtreecommitdiffstats
path: root/share/patterns
diff options
context:
space:
mode:
authorIvan Mas??r <helix84@centrum.sk>2009-05-26 15:22:40 +0000
committerhelix84 <helix84@users.sourceforge.net>2009-05-26 15:22:40 +0000
commitbee09b5eae58df54954c703414f8bf0d5b022766 (patch)
treeab6658d69e7fee01dc08e53373876bb08e494b2f /share/patterns
parent* [INTL:*] string fixes (diff)
downloadinkscape-bee09b5eae58df54954c703414f8bf0d5b022766.tar.gz
inkscape-bee09b5eae58df54954c703414f8bf0d5b022766.zip
* [INTL:*] added i18n of patterns.svg
* [INTL:*] make inkscape.pot * [INTL: sk] Slovak translation update (trunk) (bzr r7943)
Diffstat (limited to 'share/patterns')
-rw-r--r--share/patterns/Makefile.am8
-rw-r--r--share/patterns/README8
-rwxr-xr-xshare/patterns/i18n.py18
3 files changed, 32 insertions, 2 deletions
diff --git a/share/patterns/Makefile.am b/share/patterns/Makefile.am
index c92123e24..e79e262aa 100644
--- a/share/patterns/Makefile.am
+++ b/share/patterns/Makefile.am
@@ -2,7 +2,11 @@
patternsdir = $(datadir)/inkscape/patterns
patterns_DATA = \
- patterns.svg \
- README
+ README \
+ patterns.svg \
+ patterns.svg.h
+
+patterns.svg.h: patterns.svg i18n.py
+ $(srcdir)/i18n.py $(srcdir)/patterns.svg > $(srcdir)/patterns.svg.h
EXTRA_DIST = $(patterns_DATA)
diff --git a/share/patterns/README b/share/patterns/README
index b650370e4..7035a58a9 100644
--- a/share/patterns/README
+++ b/share/patterns/README
@@ -4,3 +4,11 @@ Inkscape, they can be accessed via the pattern fill option on either
Fill or Stroke tab of the Fill & Stroke dialog (Ctrl+Shift+F). You
can also create a new pattern from selected objects by the Objects
to Pattern command.
+
+Internationalization
+
+This file is internationalized the same way as share/filters/filters/svg
+The i18n.py script called from the makefile will extract strings from
+patterns.svg into a patterns.svg.h file. Intltool is then able to extracts
+these strings just like from normal .h files.
+
diff --git a/share/patterns/i18n.py b/share/patterns/i18n.py
new file mode 100755
index 000000000..3fe7f2d34
--- /dev/null
+++ b/share/patterns/i18n.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+from xml.dom import minidom
+import sys
+
+doc = minidom.parse(sys.argv[1])
+
+filters = doc.getElementsByTagName('pattern')
+
+print "char * stringlst = ["
+
+for filter in filters:
+ id = filter.getAttribute('id')
+ stockid = filter.getAttribute('inkscape:stockid')
+
+ print "N_(\"" + stockid + "\"),"
+
+print "];"