i18n: Extract messages from all installed plugins.

This makes "make i18n" extract messages for translation from all
installed plugins as well.
This commit is contained in:
Neil Williams
2013-07-18 22:43:52 -07:00
parent 928e51e886
commit a3c8867525
3 changed files with 7 additions and 1 deletions

View File

@@ -71,7 +71,7 @@ GENERATED_STRINGS_FILE := r2/lib/generated_strings.py
# POTFILE is set by Makefile.py
i18n: $(GENERATED_STRINGS_FILE)
$(PYTHON) setup.py extract_messages -o $(POTFILE)
$(PYTHON) setup.py extract_messages --input-dirs=r2,$(PLUGIN_I18N_PATHS) -o $(POTFILE)
$(GENERATED_STRINGS_FILE): $(STRINGS_FILE)
paster run standalone $(STRINGS_FILE) -c "generate_strings()" > $(GENERATED_STRINGS_FILE)

View File

@@ -30,6 +30,11 @@ print 'POTFILE := ' + os.path.join(I18N_PATH, 'r2.pot')
plugins = PluginLoader()
print 'PLUGINS := ' + ' '.join(plugin.name for plugin in plugins
if plugin.needs_static_build)
print 'PLUGIN_I18N_PATHS := ' + ','.join(os.path.relpath(plugin.path)
for plugin in plugins
if plugin.needs_translation)
import sys
for plugin in plugins:
print 'PLUGIN_PATH_%s := %s' % (plugin.name, plugin.path)

View File

@@ -34,6 +34,7 @@ class Plugin(object):
config = {}
live_config = {}
needs_static_build = False
needs_translation = True
errors = {}
def __init__(self, entry_point):