# HG changeset patch # User Thierry Florac # Date 1528886144 -7200 # Node ID f2323704d6c3b1add84719a914e179d3dc151831 # Parent 771482d50c94df4ddc89730906ad567bcd6bbf34 Corrected I18n preview diff -r 771482d50c94 -r f2323704d6c3 src/pyams_content/features/preview/zmi/templates/preview.pt --- a/src/pyams_content/features/preview/zmi/templates/preview.pt Wed Jun 13 12:35:21 2018 +0200 +++ b/src/pyams_content/features/preview/zmi/templates/preview.pt Wed Jun 13 12:35:44 2018 +0200 @@ -36,7 +36,7 @@ tal:attributes="class string:small ${active}"> + tal:attributes="href string:#preview-${lang}"> diff -r 771482d50c94 -r f2323704d6c3 src/pyams_content/features/renderer/__init__.py --- a/src/pyams_content/features/renderer/__init__.py Wed Jun 13 12:35:21 2018 +0200 +++ b/src/pyams_content/features/renderer/__init__.py Wed Jun 13 12:35:44 2018 +0200 @@ -43,7 +43,11 @@ """Get rendering adapter based on selected renderer name""" if request is None: request = check_request() - return request.registry.queryMultiAdapter((self, request), self.renderer_interface, name=self.renderer or '') + renderer = request.registry.queryMultiAdapter((self, request), self.renderer_interface, + name=self.renderer or '') + if 'lang' in request.params: + renderer.language = request.params['lang'] + return renderer @adapter_config(context=IRenderedContent, provides=IContentRenderer) diff -r 771482d50c94 -r f2323704d6c3 src/pyams_content/features/renderer/interfaces/__init__.py --- a/src/pyams_content/features/renderer/interfaces/__init__.py Wed Jun 13 12:35:21 2018 +0200 +++ b/src/pyams_content/features/renderer/interfaces/__init__.py Wed Jun 13 12:35:44 2018 +0200 @@ -41,6 +41,7 @@ label = Attribute("Renderer label") weight = Attribute("Renderer weight") settings_interface = Attribute("Renderer target interface") + language = Attribute("Renderer language (if forced)") class ISharedContentRenderer(IContentRenderer): diff -r 771482d50c94 -r f2323704d6c3 src/pyams_content/features/renderer/zmi/__init__.py --- a/src/pyams_content/features/renderer/zmi/__init__.py Wed Jun 13 12:35:21 2018 +0200 +++ b/src/pyams_content/features/renderer/zmi/__init__.py Wed Jun 13 12:35:44 2018 +0200 @@ -47,7 +47,6 @@ def update(self): renderer = self.renderer if renderer is not None: - renderer.language = self.language renderer.update() def render(self):