jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Archive for the ‘languages’ tag

Using url_title() with Spanish or other strange characters

with 3 comments

If you are running your site in Spanish and using url_title to create Permalinks in CodeIgniter then likely you had run in character issues while creating your links.

Martin posted a solution in CodeIgniter’s forum with a workaround for this issue. He proposed


$trans = array(
                    $search                                => $replace,
                    "á"                                    => 'a',
                    "é"                                    => 'e',
                    "í"                                    => 'i',
                    "ó"                                    => 'o',
                    "ú"                                    => 'u',
                    "à"                                    => 'a',
                    "è"                                    => 'e',
                    "ì"                                    => 'i',
                    "ò"                                    => 'o',
                    "ù"                                    => 'u',
                    "ñ"                                    => 'n',
                    "ä"                                    => 'a',
                    "ë"                                    => 'e',
                    "ï"                                    => 'i',
                    "ö"                                    => 'o',
                    "ü"                                    => 'u',
                    "\s+"                                => $replace,
                    "[^a-z0-9".$replace."]"                => '',
                    $replace."+"                        => $replace,
                    $replace."$"                        => '',
                    "^".$replace                        => ''
                   );

My two cents here are the following. You can try to override the URL Helper by extending it in MY_url_helper.php under application/helpers directory.

Written byadmin

March 14th, 2010 at 8:51 am

A straightforward way to translate your language files in CodeIgniter

without comments

Months ago we discussed about different alternatives to add i18n support to CodeIgniter applications. On this opportunity we will show how easy is to maintain your language files using CodeIgniter Language File Translator by MrKirkland and Owen Christian.

Basically what you need to do is download the zip here and then unpack the files under appropriate location, as explained in the article.

Read the rest of this entry »

Written byadmin

January 12th, 2010 at 7:22 pm