Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 17 revisions

[b]Overview[/b] This package allows you to select the national language of your web site. The initial language is determined from the browser's language list as available to PHP as the $_SERVER['HTTP_ACCEPT_LANGUAGE'] value. This list should reflect the language preferences of the user.

The entries of the browser's list usually are predefined by the language variant of the browser, but the user can modify this list if he or she likes to read web content in various languages.

In general your web site will not support all languages of the world. So you configure the supported languages and the directories that contain the necessary CodeIgniter language files. The language detection tries to find a supported language that is in the browswer's list. If that fails, a configured default language is used.

Additionally you can insert a view element for language selection at some position of your web page that allows to override the initial setting. To persist this overridden language selection a cookie is used. For this selection a flashdata supporting CodeIgniter Session library is necessary, e.g. Native session, DB Session or OB Session.

The language selection results in a change of the standard Code Igniter language configuration ($config['language']), so no further modifications of your web application is necessary.

[b]Requirements[/b]

[b]See It Run[/b] You can find a demo site [url=http://lang_select.blochberger.us/]here[/url].

[b]Download[/b] All files necessary for the Language Selection are here: [url=http://roland.blochberger.us/lang_select_20070401.zip]lang_select_20070401.zip Release 1, 2007-04-01[/url].

[b]Further Documentation[/b] Please find more documentation [url=http://roland.blochberger.us/index.php/pages/packdesc/lang_select]at my site[/url].

Category:Internationalization

Clone this wiki locally