Title: permalink for other languages
Last modified: August 21, 2016

---

# permalink for other languages

 *  Resolved [coder_cpp](https://wordpress.org/support/users/coder_cpp/)
 * (@coder_cpp)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/permalink-for-other-languages/)
 * Hi Carlos,
 * first of all, thank you very much for great plugin.
 * I’m currently implementing subscription service and I need to have links to newly
   added blog post in the email. I have a post ID, so I can get the permalink by
   using WP function get_permalink($post_id). This returns the permalink just for
   one language. How can I get the link for specific languages?
 * Thanks you for your help.
 * Best Regards,
    Gabriel
 * [https://wordpress.org/plugins/qtranslate-slug/](https://wordpress.org/plugins/qtranslate-slug/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [schotte](https://wordpress.org/support/users/schotte/)
 * (@schotte)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065021)
 * I second that!
 *  Plugin Author [Pedro Carvalho](https://wordpress.org/support/users/pedroghandi/)
 * (@pedroghandi)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065024)
 * Me three! 😀
 * i’ve been planning to make one, there’s so many uses for it.
 * But right now i’m busy fixing the menus, so i think it won’t come out this release
   just yet.
 *  [vbkun](https://wordpress.org/support/users/vbkun/)
 * (@vbkun)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065025)
 * Had the same need here.
 * Checked the DB and the ‘official’ slug in wordpress is the default lang slug,
   that’s why the get_permalink just returns the default slug.
 * Translated slugs are metas in the post meta table, their key is ‘_qts_slug_previx’,
   so I built a quick function to pick the slug from id using wordpress’ get_post_meta:
 *     ```
       function getLanguageSlug($id, $lang){
       	$post = get_post($id);
       	$slugArray = get_post_meta( $id, '_qts_slug_'.$lang );
       	echo $slugArray[0];
       }
       ```
   
 * Just add to your functions, provide the id and the language prefix like this:
 * `getLanguageSlug(41, 'en')`
 * and it will echo the slug in the requested language.
 * Hope this is also useful to someone else.
 *  Plugin Author [Pedro Carvalho](https://wordpress.org/support/users/pedroghandi/)
 * (@pedroghandi)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065026)
 * Awesome! I did a quick update based mainly on pull requests and suggestions. 
   Your function ( i changed it a little) is now in the plugin. You can call it 
   by: qts_get_slug or directly to the qts class.
 * Thanks everyone!
 *  [ezezag](https://wordpress.org/support/users/ezezag/)
 * (@ezezag)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065027)
 * Hello!
 * I have the same problem; in my case the proble I think it can be because of the
   permalinks. I will try to explain:
 * I have apage in 2 languages, whose permalinks are:
    – In spanish (default language):
   [http://www.XXXXX.com/es/probando](http://www.XXXXX.com/es/probando) – In basque:
   [http://www.XXXXXX.com/eu/frogatzen](http://www.XXXXXX.com/eu/frogatzen)
 * Well, from Spanish (www.XXXXX.com/es/probando) y check the basque language and
   it goes to (www.XXXXX.com/**eu/probando**). The link is not correct, but it WORKS
   the webpage.
 * When I do the same thing, but from Basque (www.XXXXXX.com/eu/frogatzen) to spanish,
   it goes to (www.XXXXXX.com/**es/frogatzen**). But in this case, the webpage DOES
   NOT WORK.
 * So I don’t think what can I do to solve the problem. Maybe you could do the permalink
   to work in the second case, despite the permalink is not correct at all?
 * Could you help me?
 * Thank you so much!!
 *  [ezezag](https://wordpress.org/support/users/ezezag/)
 * (@ezezag)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065028)
 * *Excuse me, when I say that the webpage does not work, I mean that I have a 404
   error.
 * Thanks 😉
 *  [Thjons](https://wordpress.org/support/users/thjons/)
 * (@thjons)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065061)
 * Found this solution helpful for Icelandic: I dug around the WordPress code and
   found the replacement function. It’s called remove_accents and is in the file
   wp-includes/formatting.php. There, right before the line “// Decompositions for
   Latin Extended-A” I added the following code:
 * chr(195).chr(144) => ‘D’, chr(195).chr(176) => ‘d’,
    chr(195).chr(158) => ‘TH’,
   chr(195).chr(190) => ‘th’, chr(195).chr(134) => ‘AE’,chr(195).chr(166) => ‘ae’,
 * Now the characters are replaced automatically like this: Ð => D, ð => d, Þ =>
   TH, þ => th, Æ => AE, æ => ae. I don’t know if everyone has this problem, or 
   if it just has to do with the character set settings on my webhost but this works
   great for me. No more manually fixing page slugs!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘permalink for other languages’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate-slug_5fb35e.svg)
 * [Qtranslate Slug](https://wordpress.org/plugins/qtranslate-slug/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate-slug/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate-slug/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate-slug/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate-slug/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate-slug/reviews/)

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * 7 replies
 * 6 participants
 * Last reply from: [Thjons](https://wordpress.org/support/users/thjons/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/permalink-for-other-languages/#post-5065061)
 * Status: resolved