Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Dorian 7 years, 12 months ago.

Assigned support staff: Andreas Neuber.

Author Posts
September 24, 2012 at 5:31 am #76566

Dorian

Hi folks,
Just starting to get in touch with pure WPML awesomess.

One thing still puzzles me: I can't find how to edit the default language directory name that would be used by WPML... For instance, since my translated content is to be in Simplified Chinese, WPML wants to name the translation directory ".../zh-hans/".

How can I change this to a simpler ".../zh/"?

Cheers,
D_

September 24, 2012 at 6:30 am #76580

Dorian

(just to reply in advance to potential advice, — )

I thought I had found a way, by manually adding new language info into the Languages > Edit Languages table: it seemed possible to input, among other details (such as custom flag etc), the language code; in theory, I could therefore opt for "zh" as a code, instead of the cumbersome "zh-hans"... but if I do so, I get a laconic "Adding language failed" error message.

So it seems the WPML plugin needs to actually recognize a valid language code to add a new language.

Seriously guys, who would use such a lengthy code as "zh-hans"?
(looks like the kind of directory where you'd find pictures of some German guy or sth, serious turn-off)

... So anyway, can I get around this without going for the sub-domain option?

September 24, 2012 at 7:13 am #76586

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Dear Dorian,

true, zh-hans is a bit lengthy and "Hans" is a very common German first name.

Please try this:
1) Go to "WPML > Site Languages"
2) In the box you should see a blue link "Edit languages" , click on it
3) The "Edit Languages" screen appears
4) in there on the right bottom corner, click on "Add language"
5) then add this:

- Language name --> "Chinese ZH"
- Code --> "zh"
- Flag --> "zh-hans.png" with option "upload flag"
- Default locale --> "zh_CN"
- Encode URLs --> "No"

6) Click on "Save"
7) Click on "Back to language" on the left

This should add Chinese translations in a "/zh" folder.
Let me know if that works for you.

September 24, 2012 at 11:37 am #76632

Dorian

Hi Andreas,

Many thanks for your advice, I hadn't tried hard enough :-/
!

Cheers,
Dorian

(PS -- Sorry about the "Hans" joke, very low-level, lack of sleep on my side)

September 25, 2012 at 6:30 am #76791

Andreas Neuber
Supporter

Languages: English (English ) German (Deutsch )

Hello Dorian,

as native German I have to admit that the first time I saw the abbreviation "/zh-hans" I also associated it in my mind with "Hans Zh." of Germany 🙂

So, your Chinese translations are located now in a ./zh subfolder and things work fine?

September 25, 2012 at 2:31 pm #76920

Dorian

Hey Andreas,
Yep, at least I was able to add Chinese with just that language code. Haven't had the time to test anything else yet, but let's wait and see!

Danke,
Dorian

The topic ‘[Closed] Custom Language URL’ is closed to new replies.