CodeIgniter Forums
Internationalization (i18n) library for CodeIgniter how to set langugage with dropdown list - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Internationalization (i18n) library for CodeIgniter how to set langugage with dropdown list (/showthread.php?tid=52868)



Internationalization (i18n) library for CodeIgniter how to set langugage with dropdown list - El Forum - 06-30-2012

[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.)


Internationalization (i18n) library for CodeIgniter how to set langugage with dropdown list - El Forum - 07-07-2012

[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')

??