Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I use a prefix in my url using "add_permastruct" in my functions.php:

www.mydomain.com/the_prefix/my_category/postname

But I would like to translate "the_prefix". For example, if my site is in english, I will use the prefix "articles" and If my site is in german I will use "artikel".

English: www.mydomain.com/en/articles/my_category/postname

German: www.mydomain.com/de/artikel/my_category/postname

Any ideas? I use WPML plugin

share|improve this question
    
That functionality is what WPML supposed to be able to do. You should ask their support. Since WPML is a paid plugin with no free versions there is not much chance anybody here can give you any good answer. –  Mark Kaplun Feb 24 '13 at 6:33
add comment

1 Answer

I would use the following to check for each language and then output the translated permalink structure. For instance:

if(ICL_LANGUAGE_CODE==en){
//translate your english the_prefix here
}
if(ICL_LANGUAGE_CODE==de){
//translate your german the_prefix here
}

I'm not sure about this, but I would think that you should be able to use the icl_register_string() and icl_t() functions to register, and output the translated text inside the above if statements. You can find more info about those functions here: WPML Register Function

share|improve this answer
    
it is not enough to translate names here, you actually need to change the URL parsing/rewrite rules to have those pages accessible in those URLs. –  Mark Kaplun Feb 24 '13 at 6:37
    
Thanks for your answer, Mark, but... How can I do it? –  Mike Feb 24 '13 at 12:24
    
Any solution,please? –  Mike Feb 26 '13 at 18:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.