How can I select a drop-down list to display the corresponding language and language problems? I am using gettext for multiple languages now. I don't know how to solve these problems:
I. Select a drop-down list to display the corresponding language. (Select a drop-down list to display the corresponding language. do not click a button or the like)
II. Sometimes, after data is queried, you can switch the language.
Reply to discussion (solution)
1. bind the onchange event to the select control, and then perform corresponding operations.
2. pass the session value
Can I provide an example for jordan102?
I. In the onchange event, how can we convert the page to a new language? if we get the url of the current page, we will have the lang parameter in it.
My link is www.1234756.com? Lang = en
II. Can you give a specific example?
Thanks, xuzuning. How can I pass the value through the session? I mean to use the drop-down list box, such as your post query, you can write it like this: session_start (); if (isset ($ _ SESSION ['key']) {$ key = $ _ SESSION ['key'];} else {$ key = $ _ POST ['key']; $ _ SESSION ['key'] = $ _ POST ['key'];} ...... ....