File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ Changelog
551.2.16 (unreleased)
66-------------------
77
8- - Nothing changed yet.
8+ - WEB-4278 : Create translated (de) news categories vocabulary for e-guichet (citizen project)
9+ [boulch]
910
1011
11121.2.15 (2025-05-14)
Original file line number Diff line number Diff line change 1111from zope .schema .vocabulary import SimpleTerm
1212from zope .schema .vocabulary import SimpleVocabulary
1313from zope .schema .interfaces import IVocabularyFactory
14+ from zope .i18n import translate
1415
1516
1617class NewsCategoriesVocabularyFactory :
@@ -28,6 +29,23 @@ def __call__(self, context=None):
2829NewsCategoriesVocabulary = NewsCategoriesVocabularyFactory ()
2930
3031
32+ class NewsDeCategoriesVocabularyFactory :
33+ def __call__ (self , context = None ):
34+ vocabulary = NewsCategoriesVocabularyFactory ()(context )
35+ translated_terms = [
36+ SimpleTerm (
37+ value = term .value ,
38+ token = term .token ,
39+ title = translate (term .title , target_language = "de" ),
40+ )
41+ for term in vocabulary
42+ ]
43+ return SimpleVocabulary (translated_terms )
44+
45+
46+ NewsDeCategoriesVocabulary = NewsDeCategoriesVocabularyFactory ()
47+
48+
3149class NewsLocalCategoriesVocabularyFactory :
3250 def __call__ (self , context = None , lang = "fr" ):
3351 if IPloneSiteRoot .providedBy (context ):
Original file line number Diff line number Diff line change 66 component =" .vocabularies.NewsCategoriesVocabulary"
77 provides =" zope.schema.interfaces.IVocabularyFactory"
88 />
9+
10+ <utility
11+ name =" imio.news.vocabulary.NewsDeCategories"
12+ component =" .vocabularies.NewsDeCategoriesVocabulary"
13+ provides =" zope.schema.interfaces.IVocabularyFactory"
14+ />
915
1016 <utility
1117 name =" imio.news.vocabulary.NewsLocalCategories"
You can’t perform that action at this time.
0 commit comments