OSDN Git Service

i18n: build system update
authorMartin Renold <martinxyz@gmx.ch>
Sun, 23 Aug 2009 09:25:28 +0000 (11:25 +0200)
committerMartin Renold <martinxyz@gmx.ch>
Sun, 23 Aug 2009 09:25:28 +0000 (11:25 +0200)
Always build mypaint.pot.
Generate POTFILES.in from git.

.gitignore
po/POTFILES.in [deleted file]
po/README
po/SConscript

index b5c395d..91e9622 100644 (file)
@@ -14,3 +14,5 @@ mypaint
 options.cache
 *.mo
 *.pot
+POTFILES.in
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
deleted file mode 100644 (file)
index 31a2a07..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-gui/drawwindow.py
-gui/brushselectionwindow.py 
-gui/brushsettingswindow.py
-gui/functionwindow.py
-gui/gtkexcepthook.py
-gui/settingswindow.py
-brushlib/brushsettings.py
index 20dd34e..25b7bcc 100644 (file)
--- a/po/README
+++ b/po/README
@@ -1,7 +1,10 @@
-Before starting to translate, you should update the po file for your language.
+Before working on a translation, update the po file for your language.
 For example, for the french translation, run:
 
 scons translate=fr
 
-TODO: describe how to add a new translation
+To start a new language, generate only the template mypaint.pot with:
 
+scons translate=pot
+
+Just put the new .po file into this directory and run scons.
index 2743f4b..dedf353 100644 (file)
@@ -7,16 +7,20 @@ for src in env.Glob('*.po'):
     languages.append(lang)
     dst = join(lang, "LC_MESSAGES", 'mypaint.mo')
     Command(dst, src, 'msgfmt $SOURCE -o $TARGET')
-print 'Translations:', ', '.join(languages)
 
 lang = ARGUMENTS.get('translate')
 if lang:
+    env.Execute('git grep --full-name --files-with-matches "^from gettext import" .. | sort > POTFILES.in')
+    env.Execute('intltool-update -g mypaint --pot')
     if lang == 'all':
         translate = languages
+    elif lang == 'pot':
+        translate = []
     else:
         translate = [lang]
     for lang in translate:
-        print 'Updating translation:', lang
         env.Execute('intltool-update -g mypaint %s' % lang)
+    # don't build any targets
+    Exit()
 
 Return('languages')