Odoo Help

0

Different web page structure for various languages

By
IT Libertas
on 9/25/15, 8:20 AM 902 views

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.

1

IT Libertas

--IT Libertas--
813
| 4 3 7
Saint Petersburg, Russian Federation
--IT Libertas--

Visit us: itlibertas.com

IT Libertas is a team of developers and automation experts to help you to unlock Odoo ERP system's potential. We have been communicating with end users to whom the software became a main business tool since 2012. As a result, we are proud of dozens of successful implementations.

IT Libertas guarantees deadlines predictability and transparent pricing. We rely upon the best international practices and invest in local markets' study. That is why the company's services are in demand of European, Asian, American and African entrepreneurs.

We are open for cooperation and keep searching for new solutions to the end that IT Libertas clients go ahead of the curve, deal with less routine and generate more profit.

IT Libertas
On 9/26/15, 1:31 PM

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 style="color:#FF0000;">
        <span class="mb16 fa fa-question-circle fa-5x" src="" style="animation-play-state: paused; transition: none"/>
    </span>
</div>
<div class="mt16 col-md-5" t-if="request.lang == 'de_DE'">
    <span style="color:#FF0000;">
        <span class="mb16 fa fa-question fa-5x" src="" style="animation-play-state: paused; transition: none"/>
    </span>
</div>

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.

1

Ermin Trevisan

--Ermin Trevisan--
5274
| 6 5 7
Walchwil, Switzerland
--Ermin Trevisan--


Ermin Trevisan
On 9/25/15, 8:41 AM

The app seems appropriate. Thank you. However, it doesn't cover all cases. Do you know the principles which are in base of the module? Some xml attributrs, controller functions?

IT Libertas
on 9/25/15, 8:53 AM

If you download the app, you can check the code and see. This app only offers a mulitlingual banner building block, but you can develop the same for other building blocks.

Ermin Trevisan
on 9/25/15, 9:05 AM

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

Question tools

2 follower(s)

Stats

Asked: 9/25/15, 8:20 AM
Seen: 902 times
Last updated: 9/16/16, 4:56 AM