[Zope3-checkins] CVS: Zope3/src/zope/app/translation_files -
extract.py:1.2
Jim Fulton
jim at zope.com
Mon Aug 4 08:11:59 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/translation_files
In directory cvs.zope.org:/tmp/cvs-serv14734/src/zope/app/translation_files
Modified Files:
extract.py
Log Message:
Took a first cut at extracting zcml strings. The strings are
extracted and merely printed. Stephan is going to integrate these with
the POT file.
=== Zope3/src/zope/app/translation_files/extract.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/translation_files/extract.py:1.1 Thu Apr 3 11:18:36 2003
+++ Zope3/src/zope/app/translation_files/extract.py Mon Aug 4 07:11:55 2003
@@ -59,8 +59,22 @@
return files
+def zcml_strings(dir, domain="zope"):
+ from zope.app._app import config
+ dirname = os.path.dirname
+ site_zcml = os.path.join(dirname(dirname(dirname(dir))), "site.zcml")
+ context = config(site_zcml, execute=False)
+ return context.i18n_strings.get(domain, {})
+
def main(argv=sys.argv):
dir = app_dir()
+
+ strings = zcml_strings(dir)
+
+ # OK, now what. I need someone who knows POT files.
+ # Stephan, heeeeelp.
+ print strings
+
sys.argv[1:] = ['-ozope.pot',]+find_files(dir, '*.py',
exclude=["pygettext.py"])
pygettext.main()
More information about the Zope3-Checkins
mailing list