summaryrefslogtreecommitdiffstats
path: root/share/palettes
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2010-11-02 17:54:12 +0000
committerJazzyNico <nicoduf@yahoo.fr>2010-11-02 17:54:12 +0000
commita000146744138ebc0cc04d2aa0565e1490fe6274 (patch)
treebe307be3b302dfd8c384f2b8e82f583aa4bb2543 /share/palettes
parenti18n. Color palette items are now translatable (see Bug #667402, Color palett... (diff)
downloadinkscape-a000146744138ebc0cc04d2aa0565e1490fe6274.tar.gz
inkscape-a000146744138ebc0cc04d2aa0565e1490fe6274.zip
i18n. Palettes translation with context (see Bug #667402, Colour palettes not translatable).
(bzr r9871)
Diffstat (limited to 'share/palettes')
-rwxr-xr-xshare/palettes/i18n.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/share/palettes/i18n.py b/share/palettes/i18n.py
index 9e381f6e0..853e29efb 100755
--- a/share/palettes/i18n.py
+++ b/share/palettes/i18n.py
@@ -4,18 +4,22 @@ import sys
import glob
import re
-palettes = sys.argv;
-
print "char * stringlst = ["
+# Gimp palette format: R G B Label (255 0 0 Red)
+
regex = re.compile(r'^\s*\d{1,3}\s+\d{1,3}\s+\d{1,3}\s+([^#\s].*)')
+regexnoc = re.compile(r'%')
-for filename in palettes:
+for filename in sys.argv[1:]:
file = open (filename, 'r')
- print '\n/* Palette: ' + filename + ' */'
for line in file:
match = regex.match(line)
if match:
- print "N_(\"" + match.group(1) + "\"),"
+ print '\n/* Palette: ' + filename + ' */'
+ search = regexnoc.search(match.group(1))
+ if search:
+ print "/* xgettext:no-c-format */"
+ print "NC_(\"Palette\", \"" + match.group(1) + "\"),"
print "];"