Re: How to change language selector format from language name to country code?

Solved

How to change language selector format from language name to country code?

Karolis3
Shopify Partner
14 0 4

I want to show only the language code (For example: EN) on my language selector instead of "English".

How I can change this?

 

issuess.png

Accepted Solution (1)

Harsita
Shopify Partner
46 10 24

This is an accepted solution.

Hi @Karolis3 

 

Thank you for reaching out to the shopify community.

 

To show only language code instead of name, please follow the below steps.

  • Go to your theme code editor and search for file named language-localization.liquid in Snippets folder.
  • Search for language.endonym_name  in the file and replace it with language.iso_code
  • Screen shot for reference:-

Harsita_0-1694507410742.png

Now the language name will be replaced by code.

 

Do give it a try and let me know if this was helpful.

 

Thanks

Harshita || Recurpay Subscriptions

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 5 (5)

Harsita
Shopify Partner
46 10 24

This is an accepted solution.

Hi @Karolis3 

 

Thank you for reaching out to the shopify community.

 

To show only language code instead of name, please follow the below steps.

  • Go to your theme code editor and search for file named language-localization.liquid in Snippets folder.
  • Search for language.endonym_name  in the file and replace it with language.iso_code
  • Screen shot for reference:-

Harsita_0-1694507410742.png

Now the language name will be replaced by code.

 

Do give it a try and let me know if this was helpful.

 

Thanks

Harshita || Recurpay Subscriptions

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Karolis3
Shopify Partner
14 0 4

Thank you! That helped me to change to language code. 

Now it looks like this:

 

issuess2.png

 

How I can capitalize all the letters?

 

Thanks.

Karolis3
Shopify Partner
14 0 4

Everything good now, I just changed capitalize tag to to upcase and all the letter now are in upper case.

 

Thank you very much!

ByKoppel
Tourist
4 0 1

Hi Harsita!

I tried to look for the language-localization.liquid, but unfortunately i wasnțt able to find this anyware.

Screenshot 2023-12-01 at 14.28.01.png


Could you please help and let me know where to look for?

At the moment the header looks ugly like this and i would love to make some changes. Either change from "Română (românia)" to "Română", or even better to change it from "Română (românia)" to "RO".

Screenshot 2023-12-01 at 14.26.27.png

 

Thank you very much for your help!
Daniel

 

 

Hugo333
Tourist
6 0 1

It works. Thanks a lot!