The procedure to translate text in Python and JavaScript code is very similar. You could have noticed these lines at the beginning of the petstore.js file.
var _t = instance.web_t,
_lt = instance.web_lt;
These lines are simply used to import the translation functions in the current JavaScript module. They are used like below code:
this.$el.text(_t("Hello user!"));
Note - In Odoo, translations files are automatically generated by scanning the source code.
0 Comment(s)