Skip to content

Commit

Permalink
Merge pull request #2086 from plone/fix-image-scales-i18n
Browse files Browse the repository at this point in the history
fix: translate image scales in patterns
  • Loading branch information
jensens committed Jun 26, 2017
2 parents 2e0cb76 + 5b8cc7c commit c1a1a0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Expand Up @@ -38,6 +38,9 @@ New features:

Bug fixes:

- Translate image scales in patterns.
[Gagaro]

- Gruntfile generation no longer fails on introspecting resourceDirectory
configurations using a plone.browserlayer layer, by loading all layers
configured for the site used during generation.
Expand Down
3 changes: 2 additions & 1 deletion Products/CMFPlone/patterns/settings.py
Expand Up @@ -15,6 +15,7 @@
from Products.CMFPlone.patterns.tinymce import TinyMCESettingsGenerator
from Products.CMFPlone.utils import get_portal
from zope.component import getUtility
from zope.i18n import translate
from zope.interface import implementer
from zope.schema.interfaces import IVocabularyFactory

Expand Down Expand Up @@ -80,7 +81,7 @@ def image_scales(self):
'plone.app.vocabularies.ImagesScales'
)
vocabulary = factory(self.context)
ret = [{'title': it.title, 'value': it.value} for it in vocabulary]
ret = [{'title': translate(it.title), 'value': it.value} for it in vocabulary]
ret = sorted(ret, key=lambda it: it['title'])
return json.dumps(ret)

Expand Down

0 comments on commit c1a1a0a

Please sign in to comment.