Added "configure.zcml" file to correctly handle Zope translations
authorThierry Florac <thierry.florac@onf.fr>
Fri, 26 Jan 2018 15:59:57 +0100
changeset 18 8eef3d17a06f
parent 17 2ad08dd851e2
child 19 31ec78bbd5d6
Added "configure.zcml" file to correctly handle Zope translations
src/pyams_gis/configure.zcml
src/pyams_gis/include.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_gis/configure.zcml	Fri Jan 26 15:59:57 2018 +0100
@@ -0,0 +1,10 @@
+<configure
+	xmlns="http://pylonshq.com/pyramid"
+	xmlns:i18n="http://namespaces.zope.org/i18n"
+	i18n_domain="pyams_gis">
+
+	<include package="zope.i18n" file="meta.zcml" />
+
+	<i18n:registerTranslations directory="locales" />
+
+</configure>
--- a/src/pyams_gis/include.py	Fri Jan 26 15:59:12 2018 +0100
+++ b/src/pyams_gis/include.py	Fri Jan 26 15:59:57 2018 +0100
@@ -36,3 +36,6 @@
         config.scan(ignore='pyams_gis.zmi')
     else:
         config.scan()
+
+    if hasattr(config, 'load_zcml'):
+        config.load_zcml('configure.zcml')