mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -34,6 +34,7 @@ class Plugin(object):
|
||||
config = {}
|
||||
live_config = {}
|
||||
needs_static_build = False
|
||||
needs_translation = True
|
||||
errors = {}
|
||||
|
||||
def __init__(self, entry_point):
|
||||
|
||||
Reference in New Issue
Block a user