Development

#2549 ([PATCH][1.0][1.1] sfSimpleBlog - stripped title)

You must first sign up to be able to contribute.

Ticket #2549 (new defect)

Opened 2 years ago

Last modified 2 months ago

[PATCH][1.0][1.1] sfSimpleBlog - stripped title

Reported by: xtrip Assigned to:
Priority: minor Milestone:
Component: sfSimpleBlogPlugin Version: 1.0.0
Keywords: stripped title Cc:
Qualification: Unreviewed

Description

sfSimpleBlogTools::stripText($text) create a stripped text only for ASCII, french, german and spanish. Here are rule for slavonic, baltic, estonian, hungarian and romanian language. This code copy to sfSimpleBlogTools::stripText($text) function.

    // slavian, hungarian, baltic (estonian, latvian and lithuanian) and romanian

    $text = str_replace(array('Ȃ', 'ă', 'Ȃ', 'â'), 'a', $text); // romanian
    //$text = str_replace(array('Á', 'á'), 'a', $text); // czech, slovak, hungarian - as spanish
    $text = str_replace(array('Ā', 'ā'), 'aa', $text); // latvian
    $text = str_replace(array('Ą', 'ą'), 'a', $text); // lithuanian, polish
    //$text = str_replace(array('Ä', 'ä'), 'ae', $text); // estonian - is as german or no ?

    $text = str_replace(array('Č', 'č'), 'c', $text); // czech, slovak, lithuanian, slovenian, serbian, bosnian and croatian (latinica)
    //$text = str_replace(array('Č', 'č'), 'ch', $text); // latvian - conflict with czech style
    $text = str_replace(array('Ć', 'ć'), 'c', $text); // polish, serbian, bosnian and croatian (latinica)

    $text = str_replace(array('Ď', 'ď'), 'd', $text); // czech, slovak, 
    $text = str_replace(array('Ð', 'ð'), 'dj', $text); // serbian, bosnian and croatian (latinica)

    $text = str_replace(array('É', 'é'), 'e', $text); // czech, slovak, hungarian
    $text = str_replace(array('Ě', 'ě'), 'e', $text); // czech
    $text = str_replace(array('Ę', 'ę'), 'e', $text); // lithuanian, polish
    $text = str_replace(array('Ė', 'ė'), 'e', $text); // lithuanian
    $text = str_replace(array('Ē', 'ē'), 'ee', $text); // latvian

    $text = str_replace(array('Ģ', 'ģ'), 'gj', $text); // latvian

    //$text = str_replace(array('Í', 'í'), 'i', $text); // czech, slovak, hungarian - as spanish
    $text = str_replace(array('Ȋ', 'î'), 'i', $text); // romanian
    $text = str_replace(array('Į', 'į'), 'i', $text); // lithuanian
    $text = str_replace(array('Ī', 'ī'), 'ii', $text); // latvian

    $text = str_replace(array('Ķ', 'ķ'), 'kj', $text); // latvian

    $text = str_replace(array('Ľ', 'ľ'), 'l', $text); // slovak
    $text = str_replace(array('Ļ', 'ļ'), 'lj', $text); // latvian
    $text = str_replace(array('Ł', 'ł'), 'l', $text); // polish

    $text = str_replace(array('Ň', 'ň'), 'n', $text); // czech, slovak
    $text = str_replace(array('Ņ', 'ņ'), 'nj', $text); // latvian
    $text = str_replace(array('Ń', 'Ń'), 'n', $text); // polish

   // $text = str_replace(array('Ó', 'ó'), 'o', $text); // czech, slovak, polish, hungarian - as spanish
    $text = str_replace(array('Ȏ', 'ô'), 'o', $text); // slovak
    $text = str_replace(array('Õ', 'õ'), 'o', $text); // hungarian, estonian
    //$text = str_replace(array('Ö', 'ö'), 'oe', $text);  // hungarian, estonian - is as german or no ?

    $text = str_replace(array('Ř', 'ř'), 'r', $text); // czech

    $text = str_replace(array('Š', 'š'), 's', $text); // czech, slovak, lithuanian, slovenian, serbian, bosnian and croatian (latinica)
    //$text = str_replace(array('Š', 'š'), 'sh', $text); // latvian, estonian - conflict with czech style
    $text = str_replace(array('Ś', 'ś'), 's', $text); // polish
    $text = str_replace(array('Ş', 'ş'), 's', $text); // romanian

    $text = str_replace(array('Ť', 'ť'), 't', $text); // czech, slovak
    $text = str_replace(array('Ţ', 'ţ'), 't', $text); // romanian

    //$text = str_replace(array('Ú', 'ú'), 'u', $text); // czech, slovak, hungarian - as spanish
    $text = str_replace(array('Ů', 'ů'), 'u', $text); // czech
    $text = str_replace(array('Ų', 'ų', 'Ū', 'ū'), 'u', $text); // lithuanian
    $text = str_replace(array('Ū', 'ū'), 'uu', $text); // latvian
    //$text = str_replace(array('Ü', 'ü'), 'ue', $text);  // estonian - is as german or no ?
    $text = str_replace(array('Ȕ', 'ű'), 'u', $text); // hungarian

    $text = str_replace(array('Ý', 'ý'), 'y', $text); // czech, slovak

    $text = str_replace(array('Ž', 'ž'), 'z', $text); // czech, slovak, lithuanian, slovenian, serbian, bosnian and croatian (latinica)
    $text = str_replace(array('Ź', 'ź'), 'z', $text); // polish
    $text = str_replace(array('Ż', 'ż'), 'z', $text); // polish
    //$text = str_replace(array('Ž', 'ž'), 'zh', $text); // latvian, estonian - conflict with czech style

It is not correct. Any rules are conflicted. (Č, Š, Ž in czech, slovak, slovenian is C, S, Z, in latvian and estonian CH, SH, ZH) Please set it for your language.

Attachments

2549.patch (4.8 kB) - added by alecs on 01/28/10 20:54:10.

Change History

10/31/08 19:26:52 changed by Kris.Wallsmith

  • owner changed from francois to Kris.Wallsmith.

08/28/09 06:15:52 changed by Kris.Wallsmith

  • owner deleted.

01/28/10 20:53:38 changed by alecs

  • priority changed from major to minor.

$text = str_replace(array('Ū', 'ū'), 'uu', $text); // latvian conlicts with lithuanian

01/28/10 20:54:10 changed by alecs

  • attachment 2549.patch added.

01/28/10 20:54:59 changed by alecs

  • summary changed from sfSimpleBlog - stripped title to [PATCH][1.0][1.1] sfSimpleBlog - stripped title.

Updated the both versions.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.