equal
deleted
inserted
replaced
74 # cache result of execution for (rql expr / eids), |
74 # cache result of execution for (rql expr / eids), |
75 # should be emptied on commit/rollback of the server session / web |
75 # should be emptied on commit/rollback of the server session / web |
76 # connection |
76 # connection |
77 self.local_perm_cache = {} |
77 self.local_perm_cache = {} |
78 self._ = unicode |
78 self._ = unicode |
|
79 |
|
80 def set_language(self, lang): |
|
81 """install i18n configuration for `lang` translation. |
|
82 |
|
83 Raises :exc:`KeyError` if translation doesn't exist. |
|
84 """ |
|
85 self.lang = lang |
|
86 gettext, pgettext = self.vreg.config.translations[lang] |
|
87 # use _cw.__ to translate a message without registering it to the catalog |
|
88 self._ = self.__ = gettext |
|
89 self.pgettext = pgettext |
79 |
90 |
80 def property_value(self, key): |
91 def property_value(self, key): |
81 """return value of the property with the given key, giving priority to |
92 """return value of the property with the given key, giving priority to |
82 user specific value if any, else using site value |
93 user specific value if any, else using site value |
83 """ |
94 """ |