Commits

Pedro Romano  committed f9ad499 Draft

Configure Babel distutils commands: 'extract_messages', 'init_catalog', 'update_catalog' and 'compile_catalog' which greatly simplify the management of the gettext message files. The message extraction command extracts strings (properly marked) for translation from Jinja2 templates and JavaScript. For more information on Babel see: http://babel.edgewall.org/wiki/Documentation/0.9/messages.html.

  • Participants
  • Parent commits 353a0f3

Comments (0)

Files changed (2)

+# distutils commands configuration
+[extract_messages]
+output_file = tinkerer/ext/locale/tinkerer.pot
+
+[init_catalog]
+domain = tinkerer
+input_file = tinkerer/ext/locale/tinkerer.pot
+output_dir = tinkerer/ext/locale/
+
+[update_catalog]
+domain = tinkerer
+input_file = tinkerer/ext/locale/tinkerer.pot
+output_dir = tinkerer/ext/locale/
+
+[compile_catalog]
+domain = tinkerer
+directory = tinkerer/ext/locale/
     entry_points = {
         "console_scripts": [
             "tinker = tinkerer.cmdline:main"
+        ],
+        "babel.extractors": [
+            "jinja2 = jinja2.ext.babel_extract"
         ]
     },
     install_requires = requires,
     test_requires = test_requires,
     test_suite = 'nose.collector',
+    message_extractors = {
+        'tinkerer': [
+            ('**.py',   'python', None),
+            ('**.html', 'jinja2', None),
+            ('**.js', 'javascript', {
+                'extract_messages': '$._, jQuery._',
+            }),
+        ],
+    },
 )