language-switching

Language switcher - link changes URL

ε祈祈猫儿з 提交于 2019-12-24 16:44:28
问题 I am using the Transposh Wordpress plugin to make a site bilingual. The plugin comes with a dropdown language selector, but I would like to instead place a link in the navigation that toggles the site between the two languages. The default site is in English, and an example page might be xxx.com/page The other language is Portuguese, with the translated page at xxx.com/pt/page So I would like the link to toggle between these two values: <a href="example.com/pt/page">Português</a> and <a href=

Switching languages on a website with PHP

强颜欢笑 提交于 2019-12-21 22:30:33
问题 I'm just looking for some advice. I'm creating a website that offers (at least) 2 languages. The way I'm setting it up is by using XML files for the language, PHP to retrieve the values in the XML nodes. Say you have any XML file, being loaded as follows: <?php $lang = "en"; $xmlFile = simplexml_load_file("$lang/main.xml"); ?> Once the file contents are available, I just output each node into an HTML tag like so: <li><?php echo $xmlFile->navigation->home; ?></li> which in turn is equal to :

Multi-lingual web application - how do I detect the user's language in ASP.NET?

我是研究僧i 提交于 2019-12-18 01:58:54
问题 I'm building an ASP.NET web application, and all of my strings are stored in a resource file. I'd like to add a second language to my application, and ideally, I'd like to auto-detect the user's browser language (or windows language) and default to that, instead of making them choose something besides English. Currently, I'm handling all the resource population manually, so adding a second resource file and language is trivial from my point of view, if I had an easy way to automatically

Multi-lingual web application - how do I detect the user's language in ASP.NET?

孤街浪徒 提交于 2019-12-18 01:58:40
问题 I'm building an ASP.NET web application, and all of my strings are stored in a resource file. I'd like to add a second language to my application, and ideally, I'd like to auto-detect the user's browser language (or windows language) and default to that, instead of making them choose something besides English. Currently, I'm handling all the resource population manually, so adding a second resource file and language is trivial from my point of view, if I had an easy way to automatically

Switching languages on a website with PHP

心不动则不痛 提交于 2019-12-04 17:47:34
I'm just looking for some advice. I'm creating a website that offers (at least) 2 languages. The way I'm setting it up is by using XML files for the language, PHP to retrieve the values in the XML nodes. Say you have any XML file, being loaded as follows: <?php $lang = "en"; $xmlFile = simplexml_load_file("$lang/main.xml"); ?> Once the file contents are available, I just output each node into an HTML tag like so: <li><?php echo $xmlFile->navigation->home; ?></li> which in turn is equal to : <li><a href="#">Home</a></li> as a nav bar link. Now, the way in which I'm switching languages is by

Html two language option with button (without having to redirect to different page )

守給你的承諾、 提交于 2019-12-01 11:23:28
问题 I'm trying to make second language option to the website. Here are the details for the project : 1) I'm not trying to use Google translator system or any other auto translator service to change the entire website language. 2) I only trying to translate the main description part in the website. 3) I already have written and saved translated version of the description text. 4)I also made a dropdown language option button in a separate file but under same template for both language. So, to make

Multi-lingual web application - how do I detect the user's language in ASP.NET?

天大地大妈咪最大 提交于 2019-11-28 23:09:55
I'm building an ASP.NET web application, and all of my strings are stored in a resource file. I'd like to add a second language to my application, and ideally, I'd like to auto-detect the user's browser language (or windows language) and default to that, instead of making them choose something besides English. Currently, I'm handling all the resource population manually, so adding a second resource file and language is trivial from my point of view, if I had an easy way to automatically figure out what language to display. Has anybody done this, or do you have any thoughts about how I might

How can I use <ul> list instead of <select> dropdown for the languages switcher?

此生再无相见时 提交于 2019-11-27 12:33:34
问题 I use msDropDown to convert the <select> to <ul> list for languages switcher. But the problem is that with this jQuery plugin, the select takes a long time to load after page loaded. So, how can I use a ul list rather than select ? This is my select code: <select name="lang" class="language" onchange="location.href='index.php?lang='+this.value+''.$trackpage.'"> <option name="lang" data-image="style/lang/de.png" value="de">Deutsch</option> <option name="lang" data-image="style/lang/en.png"