[Checkins] SVN: Products.CMFDefault/trunk/Products/CMFDefault/locales/__init__.py - added customized makers for z3c.recipe.i18n

Yvo Schubbe y.2009 at wcm-solutions.de
Fri Jul 17 08:41:12 EDT 2009


Log message for revision 101959:
  - added customized makers for z3c.recipe.i18n

Changed:
  A   Products.CMFDefault/trunk/Products/CMFDefault/locales/__init__.py

-=-
Added: Products.CMFDefault/trunk/Products/CMFDefault/locales/__init__.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/locales/__init__.py	                        (rev 0)
+++ Products.CMFDefault/trunk/Products/CMFDefault/locales/__init__.py	2009-07-17 12:41:11 UTC (rev 101959)
@@ -0,0 +1,40 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Makers for z3c.recipe.i18n.
+
+$Id$
+"""
+import os
+
+def tal_strings_html(path, domain, include_default_domain, exclude_dirs, **kw):
+    from zope.app.locales.extract import tal_strings
+
+    return tal_strings(path, domain, include_default_domain,
+                       exclude=exclude_dirs, filePattern='*.html')
+
+def tal_strings_xml(path, domain, include_default_domain, exclude_dirs, **kw):
+    from zope.app.locales.extract import tal_strings
+
+    return tal_strings(path, domain, include_default_domain,
+                       exclude=exclude_dirs, filePattern='*.xml')
+
+def manual_pot(path, domain, **kw):
+    catalog = {}
+    manual_file = os.path.join(path, 'locales', domain+'-manual.pot')
+    if os.path.exists(manual_file):
+        manual = file(manual_file, 'r')
+        for i, line in enumerate(manual):
+           if line.startswith('msgid'):
+               catalog[line[5:].strip().strip('"')] = [(manual_file, i+1)]
+        manual.close()
+    return catalog


Property changes on: Products.CMFDefault/trunk/Products/CMFDefault/locales/__init__.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native



More information about the Checkins mailing list