Wiki

Articles tagged with "language"X
Displaying 1-3 of 3 result(s).

SEO-conform Multilingual URLs + Language Selector Widget (i18n)

Created about a year ago by c@cbaTutorials35 comments – viewed 19,700 times – ( +26 )
You have a multilingual application, and you want the URL of a page to be different for different languages, to account for SEO. The URL for the contact page for example should look like http://something.com/en/contact in english, and http://something.com/de/contact in german. This tutorial describes how to make it happen. Note that currently selected language is always a part of the URL, and thus available to the application through $_GET. You don't have to use sessions variables to keep track of the language if you don't want to.

Manage (Target) Language in Multilingual Applications + A Language Selector Widget (i18n)

Created about a year ago by c@cbaTutorials9 comments – viewed 14,562 times – ( +9 )
In case of a multilingual application, one might consider it a reasonable approach to store the preferred language of the user in a session variable, and after that, every time a page is requested, to check this session variable and render the page in the indicated language. This tutorial shows a Yii-way of doing this. We implement an event handler for the onBeginRequest event; as the name of the event suggests, this event handler will be called at the beginning of each request, so its a good place to check whether a language is provided (via post, session or cookie) and set the application language accordingly. We also implement a simple Language-Selector Widget, which can render the language options as ajax-links or as a drop-down list.

Multilanguage web site controlling by get request and database allowed languages

Created about a year ago by Igor IvanovicTutorials2 comments – viewed 12,033 times – ( +6 )
First, you have to have create database table for default language and allowed languages.