Topic: slug Transliteration

Hi

I have Zegnåt's slug Transliteration script - http://get-simple.info/extend/plugin/sl … ration/33/ and it works fine with GS 2.03.

But it does not work with GS 3.0. I am not a programmer but I think there should be very minor updates/changes done in this script. May be anybody familiar with PHP could tell me what should be fixed? Thank you :) :) :)

The script:

<?php
    $tf = basename(__FILE__,'.php');
    register_plugin(
        $tf,
        '<code>slug</code> Transliteration',
        '2',
        'Martijn van der Ven',
        'http://zegnat.com/',
        'If you use a language with non ASCII characters <a href="http://en.wikipedia.org/wiki/Transliteration">transliteration</a> can be used by GetSimple to change your page titles into slugs.'
    );
    add_action('changedata-save','translit');
    function translit($t=false,$m=false) {
        global $i18n;
        if (is_array($a=$m)||is_array($a=@$i18n['TRANSLITERATION'])||is_array($a=@$i18n['TRANSLIT'])) {
            if (!$t&&isset($_POST['submitted'])) {
                global $url, $xml, $file;
                $t = ($u=$_POST['post-id'])?$u:($u=$_POST['post-title'])?$u:'temp';
                $url = clean_url(to7bit(str_replace(array_keys($a),array_values($a),$t)));
                unset($xml->url);
                $note = $xml->addChild('url');
                $note->addCData($url);
                $file = GSDATAPAGESPATH.$url.".xml";
                return true;
            }
            return str_replace(array_keys($a),array_values($a),$t);
        }
        else return false;
    }
?>

Re: slug Transliteration

arthur_a_keen wrote:

I have Zegnåt's slug Transliteration script - http://get-simple.info/extend/plugin/sl … ration/33/ and it works fine with GS 2.03. But it does not work with GS 3.0.

Can you please provide us with a wee bit more info? A few examples of what you entered wouldn't hurt either. We misplaced our crystal balls the other day. :)

Have you tried re-installing the plugin?

I use it with German umlauts (ÄäÖöÜü) and it works fine here.

There's another thread about the plugin which involves Russian users, maybe you'll find some answers there?

Re: slug Transliteration

polyfragmented wrote:
arthur_a_keen wrote:

I have Zegnåt's slug Transliteration script - http://get-simple.info/extend/plugin/sl … ration/33/ and it works fine with GS 2.03. But it does not work with GS 3.0.

Can you please provide us with a wee bit more info? A few examples of what you entered wouldn't hurt either. We misplaced our crystal balls the other day. :)

Have you tried re-installing the plugin?

I use it with German umlauts (ÄäÖöÜü) and it works fine here.

There's another thread about the plugin which involves Russian users, maybe you'll find some answers there?

This thread is AN old one. It is regarding GS 2.03.

My GS 2.03 works fine with it. But GS 3.0 does not work at all - it does not convert Cyrillic letters/symbols.

Re: slug Transliteration

I have installed slug transliteration but its not working for me.

I am not using german or russian, using turkish.

in wordpress default slug system, i dont have any problem but GS's slug system and also slug transliteration i didnt get true slugs (i have to modify slug whenever add a page)

can you help for that matter? for turkish language i can list irregular letters (no-latin) and slug options:

[non-latin] = slug

[iı][İI] = i
[oö][OÖ] = o
[uü][UÜ] = u
[sş][SŞ] = s
[gğ][GĞ] = g
[cç][CÇ] = c // its already convert true

these are all our non-latin characters.

or how modify slug transliteraton plug-in for turkish users.

thanks

Post's attachments

slug.png 40.56 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: slug Transliteration

You have to add a translit array to your language file.
The system has to take necessary information; it isn't being held magically.

Such array should look:
"TRANSLITERATION" => array(
  "ğ"=>"g","Ç"=>"C"
),

and so on, add your letters and don't forget to save translation file in utf-8 w/o bom format/

wujitsu.pl - simple sites, simple solutions, because I like getsimple ;)

Re: slug Transliteration

Hi again,

I am not php master =) and i didn't understand which language file?

I have modified admin/lang/en_US.php file which i used for my site language and added that code inside

"TRANSLITERATION" => array("Ç"=>"c","ç"=>"c","Ğ"=>"g","ğ"=>"g","ı"=>"i","İ"=>"i","ş"=>"s","Ş"=>"s","Ö"=>"o","Ö"=>"o"),

so nothing changed; agian when i create a page its not convert non-latin.

If i need to modify also plugin/slugtranslit.php, please let me know where exactly:


]<?php
 $tf = basename(__FILE__,'.php');
 register_plugin(
  $tf,
  '<code>slug</code> Transliteration',
  '2',
  'Martijn van der Ven',
  'http://zegnat.com/',
  'If you use a language with non ASCII characters <a href="http://en.wikipedia.org/wiki/Transliteration">transliteration</a> can be used by GetSimple to change your page titles into slugs.'
 );
 add_action('changedata-save','translit');
 function translit($t=false,$m=false) {
  global $i18n;
  if (is_array($a=$m)||is_array($a=@$i18n['TRANSLITERATION'])||is_array($a=@$i18n['TRANSLIT'])) {
   if (!$t&&isset($_POST['submitted'])) {
    global $url, $xml, $file;
    $t = ($u=$_POST['post-id'])?$u:($u=$_POST['post-title'])?$u:'temp';
    $url = clean_url(to7bit(str_replace(array_keys($a),array_values($a),$t)));
    unset($xml->url);
    $note = $xml->addChild('url');
    $note->addCData($url);
    $file = GSDATAPAGESPATH.$url.".xml";
    return true;
   }
   return str_replace(array_keys($a),array_values($a),$t);
  }
  else return false;
 }
?>

or I am working on wrong places? =(

Re: slug Transliteration

Did you save language file in utf8 format as I mentioned ?

wujitsu.pl - simple sites, simple solutions, because I like getsimple ;)

Re: slug Transliteration

yipuu! i thought DW take care about it but i am worng =) I changed the file utf-8 and now works perfectly!

thanks your amazing help.