Welcome Guest, Not a member yet? Register   Sign In
Internationalization (i18n) library for CodeIgniter how to set langugage with dropdown list
#1

[eluser]Unknown[/eluser]
Hi Everyone!

I used the Codeigniter (i18n) library to internationalization my site.
I wanna make a view file with a dropdown list with languages like this.
The user can select a language.
How can i set language with the main controller by the selected element value.
(How to add the url the selected element's value like this "http://localhost/multilang/de")

I have an Ajax.js with i can get the selected elemenet, and i can send it to controller by post.

Code:
<select>
  <option value="en">English</option>
  <option value="fr">French</option>
  <option value="hu">Hungarian</option>
  <option value="ro">Romanian</option>
</select>

( I am sorry for my bad English.)
#2

[eluser]Unknown[/eluser]
Did you try to build a list with href's to:

$this->lang->switch_uri('en')
$this->lang->switch_uri('fr')
$this->lang->switch_uri('hu')
$this->lang->switch_uri('ro')

??




Theme © iAndrew 2016 - Forum software by © MyBB