diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-02-18 15:24:00 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-08-01 12:39:56 +0000 |
| commit | f4319580e576e033b95db1627dd11f126c187323 (patch) | |
| tree | ca4bed47ea8bef3d4be415efe60b8235bb338ab1 /odoo/__init__.py | |
| parent | 0fc9a97d20a480a10dc5258dcc22bf5e52b48293 (diff) | |
[ADD] tools: lazy translation method
Introduces the method _lt
The translation method is now evaluated lazily.
It allows to declare global variables with translatable content
e.g. this code will now work:
LABEL = _lt("User")
def _compute_label(self):
context = {'lang': self.partner_id.lang}
self.user_label = LABEL
Diffstat (limited to 'odoo/__init__.py')
| -rw-r--r-- | odoo/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/__init__.py b/odoo/__init__.py index 6bfe00b8499..bf5ec3e94b4 100644 --- a/odoo/__init__.py +++ b/odoo/__init__.py @@ -100,7 +100,7 @@ from . import tools from . import models from . import fields from . import api -from odoo.tools.translate import _ +from odoo.tools.translate import _, _lt #---------------------------------------------------------- # Other imports, which may require stuff from above |
