change language code name to E instead of ENG or English

Solved

change language code name to E instead of ENG or English

usershop2024
Excursionist
19 0 1

Hello Friends,

 

I have 2 language in my shopify store.

 

I want to change the English language name from English or ENG to " E"

 

I just need letter E which is short for English

 

I would appreciate if you can provide code link to added to my store?

 

Thank you 

Accepted Solution (1)

Vinsinfo
Shopify Partner
486 165 169

This is an accepted solution.

@usershop2024Please follow the below steps to change the language name. Let me know whether it is helpful for you.

 
1. From admin, go to "Online Store" -> "Themes".
2. Click action button from the current theme and select "Edit code".
3. Locate "language-localization.liquid" file and follow either a) or b) based on your need.
a) Follow below steps if you want to update text only for the English and the French languages.
To change the displaying selected language:
Find the class "disclosure__button" paste the given code below to it like in the below attached screenshot.

 

 {% if localization.language.iso_code == 'en' %}
    <span>E</span>
{% elsif localization.language.iso_code == 'fr' %}
    <span>F</span>
{% else %}
    <span>{{ localization.language.endonym_name | capitalize }}</span>
{% endif %}

 

Vinsinfo_4-1712154214947.png
 
To change the language in the dropdown:
Find the "{%- render 'icon-checkmark' -%}" paste the given code below to it like in the below attached screenshot.

 

{% if language.iso_code == 'en' %}
    <span>E</span>
{% elsif language.iso_code == 'fr' %}
    <span>F</span>
{% else %}
    <span>{{ language.endonym_name | capitalize }}</span>
{% endif %}

Vinsinfo_2-1712154167839.png

 

 

 

b) Follow below steps if you want to update for all the available languages.
To change the displaying selected language:
Find the class "disclosure__button" paste the given code below to it like in the below attached screenshot.

 

{% assign language_title = localization.language.endonym_name | split: '' | first %}
<span>{{ language_title | upcase }}</span>

Vinsinfo_5-1712154244431.png

 

 
To change the language in the dropdown:
Find the "{%- render 'icon-checkmark' -%}" paste the given code below to it like in the below attached screenshot.

 

{% assign language_title = language.endonym_name | split: '' | first %}
<span>{{ language_title | upcase }}</span>

 

Vinsinfo_6-1712154253514.png
 
4. Then, the final output of the language selector dropdown will be like.
Vinsinfo_9-1712154349472.png

 

Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.
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)

wo
Shopify Partner
188 42 42

wo_0-1712132682624.png

 

usershop2024
Excursionist
19 0 1

@wo Thanks for your response.  

 

I added the code but it have some issue , the drop down language list have repeated Letter

 

usershop2024_0-1712145800947.png

 

If i have French and English I want to French to be F  and English to be E  , In the drop down list should have F and E,  

 

can you adjust the code ?

 

Thank you

Vinsinfo
Shopify Partner
486 165 169

This is an accepted solution.

@usershop2024Please follow the below steps to change the language name. Let me know whether it is helpful for you.

 
1. From admin, go to "Online Store" -> "Themes".
2. Click action button from the current theme and select "Edit code".
3. Locate "language-localization.liquid" file and follow either a) or b) based on your need.
a) Follow below steps if you want to update text only for the English and the French languages.
To change the displaying selected language:
Find the class "disclosure__button" paste the given code below to it like in the below attached screenshot.

 

 {% if localization.language.iso_code == 'en' %}
    <span>E</span>
{% elsif localization.language.iso_code == 'fr' %}
    <span>F</span>
{% else %}
    <span>{{ localization.language.endonym_name | capitalize }}</span>
{% endif %}

 

Vinsinfo_4-1712154214947.png
 
To change the language in the dropdown:
Find the "{%- render 'icon-checkmark' -%}" paste the given code below to it like in the below attached screenshot.

 

{% if language.iso_code == 'en' %}
    <span>E</span>
{% elsif language.iso_code == 'fr' %}
    <span>F</span>
{% else %}
    <span>{{ language.endonym_name | capitalize }}</span>
{% endif %}

Vinsinfo_2-1712154167839.png

 

 

 

b) Follow below steps if you want to update for all the available languages.
To change the displaying selected language:
Find the class "disclosure__button" paste the given code below to it like in the below attached screenshot.

 

{% assign language_title = localization.language.endonym_name | split: '' | first %}
<span>{{ language_title | upcase }}</span>

Vinsinfo_5-1712154244431.png

 

 
To change the language in the dropdown:
Find the "{%- render 'icon-checkmark' -%}" paste the given code below to it like in the below attached screenshot.

 

{% assign language_title = language.endonym_name | split: '' | first %}
<span>{{ language_title | upcase }}</span>

 

Vinsinfo_6-1712154253514.png
 
4. Then, the final output of the language selector dropdown will be like.
Vinsinfo_9-1712154349472.png

 

Please provide your support by click "Like" and "Accepted" if our solution works for you. Thanks for your support.
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