Source Rally PHP Community Scripts .. Sign up .. Login
Change $name to "$name's" depending on language:
Spanish and English
Access: Public      Tags: gettext, language, internationalization, genitive
Add to favourites       Subscribe comments       Copy code       Bookmark
function genitive($name)
{
    switch(setlocale(LC_ALL,null))
    {
        case 'es_ES':
        return ' de '.$name;
        break;
        default:
        if(strtolower(substr($name,-1))=='s')
        {
            return $name."'";
        }
        else
        {
            return $name."'s";
        }
        break;
    }
}
Add to favourites       Subscribe comments       Copy code       Bookmark
Sign up to add your own comment here!

Shared by:

regin

Mail user Add to friends
All user contributed content is available under the LGPL unless specified otherwise.
Remaining copyrights Regin Gaarsmand © 2006-2008
About SourceRally.net
Adelgazar sin trucos Programador PHP