How can I display alternate language options on my website?

Solved

How can I display alternate language options on my website?

davidwu1604
New Member
9 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)

Vinsinfo
Shopify Partner
486 165 169

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 -%}

 

Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support

View solution in original post

Replies 3 (3)

ProtoMan44
Shopify Partner
704 57 112

@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

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

Vinsinfo
Shopify Partner
486 165 169

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 -%}

 

Please reach out to bizdev@vinsinfo.com for any enquires related to Shopify.
Our Services: Custom Theme Development, Theme Customization, Custom Feature Implementation, Data Migration, Custom APP Development, Website Optimization and Google Merchant Center Support
davidwu1604
New Member
9 0 0

THANK YOU FOR YOU HELP! PROVLEM FIXED