summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorPaul Morelle <pmo@odoo.com>2020-10-27 10:01:52 +0000
committerPaul Morelle <pmo@odoo.com>2020-10-27 14:55:13 +0000
commitc77fbcf429f1f6d07c68ebe674b8c0035015328b (patch)
tree90cf89543bc84f735434cd9f14ade956b759f7ff /addons
parent5f46c50442dbe42bc534718719a6b19ee087eab0 (diff)
[IMP] translate: add add/radd methods on _lt class
In order to ease the usage of lazy translation, add the possibility to add the _lt objects together and with strings. Adding two _lt objects together or to a string will execute their translation, so these operations still must be done once the user's language has been defined. For example, this is now possible: MESSAGES = { 1: _lt("Hello, world!"), 2: _lt("Lorem ipsum"), } def get_text(code): return _("Text is: ") + MESSAGES[code] closes odoo/odoo#60842 X-original-commit: c4596664e5514018c565eaf14b93e000d972bd30 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com> Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
Diffstat (limited to 'addons')
0 files changed, 0 insertions, 0 deletions