From c489bc15c52d89abeffd8efc6a06c950bce44e0d Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 1 Nov 2010 09:45:51 +0100 Subject: i18n. Color palette items are now translatable (see Bug #667402, Color palette not translatable). Fixed bugs: - https://launchpad.net/bugs/667402 (bzr r9870) --- share/palettes/Makefile.am | 18 ++++++++++++++++-- share/palettes/echo-palette.gpl | 2 +- share/palettes/i18n.py | 21 +++++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100755 share/palettes/i18n.py (limited to 'share') diff --git a/share/palettes/Makefile.am b/share/palettes/Makefile.am index 3bb5bed88..850312e9f 100644 --- a/share/palettes/Makefile.am +++ b/share/palettes/Makefile.am @@ -21,6 +21,20 @@ palettes_DATA = \ Ubuntu.gpl \ webhex.gpl \ websafe22.gpl \ - windowsXP.gpl + windowsXP.gpl \ + palettes.h -EXTRA_DIST = $(palettes_DATA) +palettes_i18n = \ + echo-palette.gpl \ + inkscape.gpl \ + LaTeX-Beamer.gpl \ + svg.gpl \ + Tango-Palette.gpl \ + Ubuntu.gpl + +palettes.h: i18n.py $(palettes_i18n) + $(srcdir)/i18n.py $(palettes_i18n) > $(srcdir)/palettes.h + +EXTRA_DIST = $(palettes_DATA) \ + i18n.py + diff --git a/share/palettes/echo-palette.gpl b/share/palettes/echo-palette.gpl index e3215901c..1b3bf99ca 100644 --- a/share/palettes/echo-palette.gpl +++ b/share/palettes/echo-palette.gpl @@ -2,7 +2,7 @@ GIMP Palette Name: Echo Icon Theme Palette Columns: 3 # - 25 174 255 Blue1 + 25 174 255 Blue1 0 132 200 Blue2 0 92 148 Blue3 255 65 65 Red1 diff --git a/share/palettes/i18n.py b/share/palettes/i18n.py new file mode 100755 index 000000000..9e381f6e0 --- /dev/null +++ b/share/palettes/i18n.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import sys +import glob +import re + +palettes = sys.argv; + +print "char * stringlst = [" + +regex = re.compile(r'^\s*\d{1,3}\s+\d{1,3}\s+\d{1,3}\s+([^#\s].*)') + +for filename in palettes: + file = open (filename, 'r') + print '\n/* Palette: ' + filename + ' */' + for line in file: + match = regex.match(line) + if match: + print "N_(\"" + match.group(1) + "\")," + +print "];" -- cgit v1.2.3