Ruslan Ulanov’s Codeshack

The developer’s notebook

Cyr2Lat Slugs – WordPress Plugin

10 comments

?? ??????? ??????? ????…

If you happen to write Word Press posts in one of the Cyrillic-based languages (i.e. Russian, Bulgarian, Ukrainian, Belarusian, etc.) and are using post’s title in Permalinks then you know that your post’s URL will become an unreadable mash of encoded characters (like %45%f0%…)

I got finally tired of changing encoded slugs to their latin equivalents on my son’s blog, and started looking for ways to automate this process. The Cyrillic Slugs plug-in written by Petko Bossakov was my only alternative at the time in WordPress plug-in repository. Unfortunatelly that plug-in didn’t work for me, since Cyrillic Slugs expects the page to be written in Windows-1251 encoding, and my blog uses WP’s default/recommended UTF-8. Hence Cyr2Lat Slugs plug-in was born.

Here’s a sample that illustrates what this plug-in does.

Before Cyr2Lat Slugs:

  1. You write a post with title “?????? ?????????”
  2. WordPress creates permalink like this:

    http://www.myblog.com/2008/12/19/%d0%bf%d1%80%d…b2%d0%ba%d0%b0

After Cyr2Lat Slugs:

  1. You write a post with title “?????? ?????????”
  2. WordPress creates permalink like this:

    http://www.myblog.com/2008/12/19/primer-zagolovka

Cyr2Lat Slugs is based on Petko’s original idea and uses one of his functions, but otherwise is written in a more contemporary, object-oriented fashion. It also uses strtr function instead of str_replace which should be much faster.

Please note that you have to save post (click Save or Publish button) for slug conversion to take place!

Version: 1.0
Requirements: WP 2.3+ (WP MU compatible)
Author: Ruslan Ulanov
License: GPL

Download Cyr2Lat Slugs plug-in now.

Installation:

  1. Copy file cyr2lat-slugs.php to folder wp-content/plugins/ on your server.
  2. Activate Cyr2Lat Slugs in Plugins menu of your blog’s admin interface.
  3. You’re done. There are no options to configure.

Comments are welcome (moderated, no spam please).

 
#
*In Russian*

Cyr2Lat Slugs ??? ?????? ??? ????????? Word Press, ??????? ????????? ??????? ????? ? ????????? ????? ? ???????? (????????), ??? ????? ????? URL ???????? ? ????????? ??? ???????????.

???????????????? ?????? ??????? Cyr2Lat Slugs ?? ???????.

?? ????????? Cyr2Lat Slugs:

  1. ?? ?????? ???? ? ?????????? “?????? ?????????”
  2. WordPress ??????? ??? ???? ?????????:

    http://www.myblog.com/2008/12/19/%d0%bf%d1%80%d…b2%d0%ba%d0%b0

????? ????????? Cyr2Lat Slugs:

  1. ?? ?????? ???? ? ?????????? “?????? ?????????”
  2. WordPress ??????? ??? ???? ?????????:

    http://www.myblog.com/2008/12/19/primer-zagolovka

??????????: ???? ?????????? ????????? (?????? ?????? Save ??? Publish), ????? ????????? ??? ????????? ? ????????!

??????: 1.0
??????????: WP 2.3+ (???????? ? WP MU)
?????: ?????? ??????
????????: GPL

????????? Cyr2Lat Slugs.

?????????:

  1. ?????????? ???? cyr2lat-slugs.php ? ????? wp-content/plugins/ ?? ???????.
  2. ??????????? Cyr2Lat Slugs ? ???? Plugins ????????????????? ?????????? ?????? ?????.
  3. ??????. ?????? ?????? ??????????????? ?? ????.

??????????? ?????????????? (?? ????????????, ??? ?????????? ?????).

Written by Ruslan Ulanov

December 10th, 2008 at 7:41 pm

Posted in PHP

Tagged with

10 Responses to 'Cyr2Lat Slugs – WordPress Plugin'

Subscribe to comments with RSS or TrackBack to 'Cyr2Lat Slugs – WordPress Plugin'.

  1. hi. Thanks for plugin

    perfect.

    Regards

    You are welcome

    Ruslan

    baron

    12 Dec 08 at 4:54 am

  2. Unfortunally, this plugin doesn’t work on re-publishing old posts…

    Anyway, thank you very much!

    Eugene,

    Yes, once permalink is created my plug-in will not touch it (otherwise it wouldn’t be a permalink). Though, I might consider creating a separate button in the editor to force update of the permalink. Thanks for the idea.

    Ruslan

    Eugene

    21 Mar 09 at 1:53 am

  3. Hello,
    I just downloaded your plugin and will give it a try.
    I would like to ask – is there a way to change the transliteration rules (to correspond the Bulgarian alphabet)

    Thank you.

    Hi Dimitre,
    Currently there is no admin interface for changing transliteration rules (a good idea though), but you can open the PHP file in your favorite text editor and make the changes if you like.

    Ruslan.

    Dimitre

    7 Apr 09 at 11:47 pm

  4. ?????? ??? ??? ???-?? ?????? ???????????? ?????. ??????? ?? ??????????, ????? ?????????.

    Illiblyneew

    12 May 09 at 11:18 am

  5. ?????????? ????, ???????? ?? ?????

    Steptacramp

    12 May 09 at 7:31 pm

  6. ???????? ?? ? ????? ??????

    JatBoodssnins

    13 May 09 at 8:02 am

  7. ??????? ? ????????? ? ?????? ????? ????? ? ???? ??????????

    Greehorgops

    14 May 09 at 7:50 am

  8. ?????. ? ?? ??????. :)

    rusgrafx

    21 May 09 at 6:54 pm

  9. ???-???? ??????? ??????????? – ????. ???????? ?? ??????? ????, ?? ???????? ?????? ??????????, ?????? ??????? ? ???? ???????????? ???????? ? ????? ????????? ??? ???? ????? ????? ??????? ?? ???? ?????. :)

    Xo????????o?a

    25 May 09 at 6:43 pm

  10. ??????? ?? ?? ??? ???????? ??? ???, ????? ??? ????????

    MamyGreespemy

    9 Oct 09 at 6:12 pm

Leave a Reply