Solved

language display

davidwu1604
New Member
6 0 0

Hi , I have two language for the website, English & Chinese

I am wondering if it's possible to display the opposite language? For example, 

If i am on English version now, can the language selector show Chinese (in Chinese word) so people will know that we have other language option. I am using flow theme

davidwu1604_0-1706871283822.png

Thanks!

Accepted Solution (1)

priyavinsinfo
Shopify Partner
45 10 6

This is an accepted solution.

Please try below code to do this.

1. Go to "Online Store" -> "Themes".
2. Select Edit code.
3. Go to language-localization.liquid file.
4. Paste below code instead of the line "<span>{{ localization.language.endonym_name | capitalize }}</span>"

 

{%- for language in localization.available_languages -%}
      {% if localization.language.iso_code != language.iso_code %}
        <span> {{ language.endonym_name | capitalize }}</span>
        {%- break -%}
      {% endif %}
{%- endfor -%}

 

View solution in original post

Replies 3 (3)

ProtoMan44
Shopify Partner
146 13 23

@davidwu1604 

please use this app i hope it will work:
https://apps.shopify.com/geolocation

 

- A thirsty developer passionate about supporting the community. If you'd like to, you can buy me a

Coffee

.
- Your Shopify Solution Specialist Get a Quote at Dev444- Whatsapp +92-3046185085
Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

priyavinsinfo
Shopify Partner
45 10 6

This is an accepted solution.

Please try below code to do this.

1. Go to "Online Store" -> "Themes".
2. Select Edit code.
3. Go to language-localization.liquid file.
4. Paste below code instead of the line "<span>{{ localization.language.endonym_name | capitalize }}</span>"

 

{%- for language in localization.available_languages -%}
      {% if localization.language.iso_code != language.iso_code %}
        <span> {{ language.endonym_name | capitalize }}</span>
        {%- break -%}
      {% endif %}
{%- endfor -%}

 

davidwu1604
New Member
6 0 0

THANK YOU FOR YOU HELP! PROVLEM FIXED