Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Website translation mode allows translating only texts. Is it possible to show different images/blocks for different languages as well?
For example, the page is the same for various languages, the only difference is in one image. Especially it is required in case of posting screenshots for service description or for user mannuals.
A little investigation leads to the method:
1. Basically, we may learn current language by using request.lang
2. We may show / not show the element bu using t-if
Such approach allow making different structure for various languages. For example, to show different types of question marks for en_US and de_DE languages:
<div class="mt16 col-md-5" t-if="request.lang == 'en_US'">
<span class="mb16 fa fa-question-circle fa-5x" src="" style="animation-play-state: paused; transition: none"/>
<div class="mt16 col-md-5" t-if="request.lang == 'de_DE'">
<span class="mb16 fa fa-question fa-5x" src="" style="animation-play-state: paused; transition: none"/>
It is important, that no controller rewriting is required, only xml change.
A problem is that element in not default language may be changed only via HTML editor, since Website editor is for default language.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/25/15, 8:20 AM|
|Seen: 1284 times|
|Last updated: 9/16/16, 4:56 AM|