Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7137 Lượt xem

Anyone who knows how I can change the way the translation languages are displayed in the automatic footer?

I want to put a country flag for each language instead of the name of the language.

For example I want to display the Swedish flag for the Swedish language instead of the word "Swedish". 



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi. Maybe you can tell us how did you resolved your issue (for other people in the community)?

For Odoo 8, a module displaying countries flags in the top navigation bar exists: https://www.odoo.com/apps/modules/8.0/website_lang_flags/ (but it must be debug).

Ảnh đại diện
Huỷ bỏ
Tác giả

Sure! You have to replace the following code in automatic footer

  • Add a language...
  • with this code: german english As you see I wrote a t-if with the language name (lang_name="theLanguageIwant") and in this t-tag I inserted the image of the flag.
    Tác giả

    Ok, I see that I cannot write code in comments so I will write the solution as an answer instead.

    Tác giả Câu trả lời hay nhất

    [SOLUTION]

    You have to replace the following code in automatic footer

    <li groups="base.group_website_publisher">

        <t t-set="url_return" t-value="url_for('', '[lang]') + '?' + keep_query()"/>

        <a t-attf-href="/web#action=base.action_view_base_language_install&amp;website_id=#{website.id}&amp;url_return=#{url_return}">

            <i class="fa fa-plus-circle"/>

            Add a language...

        </a>

    </li>


    with this code:

     <t t-if="lang_name == ' Deutsch'">

        <img alt="german" src="/theme_teamdoc/static/src/img/kastrup_genberg/ger.png"/>

    </t>

    <t t-if="lang_name == 'English'">

        <img alt="english" src="/theme_teamdoc/static/src/img/kastrup_genberg/uk.png"/>

    </t>

    As you see I wrote a t-if with the language name (lang_name="theLanguageIwant") and in this t-tag I inserted the image of the flag.

     

    Ảnh đại diện
    Huỷ bỏ

    Thank you :-)

    You are welcome :)

    2015-11-18 10:57 GMT+01:00 Massinissa Belkassam <massinissa.belkassam@davidts.be>:

    Thank you :-)

    --
    Massinissa Belkassam
    Sent by Odoo S.A. using Odoo about Forum Post False

    Bài viết liên quan Trả lời Lượt xem Hoạt động
    1
    thg 3 15
    9193
    0
    thg 5 24
    3012
    0
    thg 10 21
    2786
    1
    thg 3 21
    3837
    0
    thg 11 16
    4153