Jump to content

How can I use "language code" instead of "ISO code" for friendly URL?


Recommended Posts

Hi All,

 

Sorry I can't found the correct discussion for my problem therefore I need drop a new topic.

 

I am using v1.6.1.0

 

the ISO code for traditional chinese is "tw". However I want "hk" be shown in my URL not "tw"

 

I have 2 ideas to go:

 

1, change ISO code from "tw" to "hk" . But "hk" is not a correct ISO code. I think there is something wrong if I do this? maybe browse language detection issue or any thing else.

 

2, name the language code to "hk" and change to friendly URL logic to use language code instead of ISO code. but how can I make it?

 

(P.S. language code for raditional chinese is zh-hk , any problem if I change it to hk ?)

 

 

 

anyone can help me, thanks a lot~~~~~~~!!!!!!

 

Eli

Edited by hihihihi88 (see edit history)
Link to comment
Share on other sites

for consideration.

 

export your 'tw' language (zh-TW)  back office-->translations-->scroll down to export a language

 

modify the pack (will require research) and change to zh-HK

 

import your new zh-HK language pack from back office--translations-->scrolld down to import a language

 

Note: use a back up that you know you are able to resore in case of issue and/or do on a copy of your shop.

 

Once you get the hang of this, then PrestaShop will naturally present correct language (and code) based on visitor browser (caveats: 1) only looks at first language of browser, there can be multiplies with weight factor 2) PrestaShop does not display 'true' localized language in url, i.e zh-tw but tw....we hope to see best practice ietf url support in the future.)  Benefits, 1) better visitor localization 2) another langue in your shops seo inluding sitemap.

 

Happy day, el

 

 

notes:

Chinese zh-CN Mainland China, simplified characters Chinese zh-TW Taiwan, traditional characters Chinese zh-HK Hong Kong, traditional characters
Link to comment
Share on other sites

thanks a lot, I will try this weekend~~~!!!!

 

You are very welcome.  Please let me know how it goes.

 

If you can take 'very' similar languages and multiplex them (i.e. run sitemap) this would be good for SEO.

 

Someday in the future we would like to see PrestaShop support the ietf code in the url, this is a better signal for search engines than two character iso code. :)

Link to comment
Share on other sites

  • 3 weeks later...

I tried export and import language pack. therefore I have a backup and change to zh-hk

 

However, I want to change my prestashop URL from

"mysotre.com/tw/" to "mysotre.com/hk/"

 

how can I do it?

"hk" is not a correct ISO code

 

if we import the Hong Kong language pack, the iso code is zh, languge code (ietf) is zh-cn, when we switch to this language the url will be /zh/.  (note: this is default native PS handling of zh-cn).

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...