then it has never been easier: Check out this new extension which does the dirty work for you.
http://www.yiiframework.com/extension/localeurls/
It’s quick and easy to install, does not require any extra URL rules, creates language URLs transparently, supports a default language and persists the current language selection in session and a cookie.
That’s a different story . You’ll need a custom URL rule for this case anyway because how should an extension know, how you want to translate your page names?
This extension is only for applications where the URLs use the above patterns.
Updated the extension to 1.1.0: Handling of the default language has been improved. Default is now, whatever you configure in your main app config. You can decide if you want a redirect from www.example.com to www.example.com/en (if en is your default), by setting redirectDefault. Default is false.
And yet another update (1.1.2): The extension now by default tries to auto detect the preferred user language from the HTTP headers (using CHttpRequest::preferredLanguages). It can be disabled through ‘detectLanguage’ => false.