kurt.santo Posted December 11, 2007 Share Posted December 11, 2007 As the content in my website is pulled in with includes the file names are always in English. Is there a way to make them German when someone put "?lang=de" onto the querystring? Also, I always wondered what do search engines do when they encounter the link with the querystring (<a href="?lang=de">?Kurt Link to comment Share on other sites More sharing options...
justsomeguy Posted December 11, 2007 Share Posted December 11, 2007 If you want to use language-specific files then you need to set up a big lookup table where you store all the different filenames for all the different languages that you can use to look up which file to use on a specific page with a specific language. It sounds like more work then it's worth. Also, I always wondered what do search engines do when they encounter the link with the querystring (<a href="?lang=de">?Nothing different then for any other page. It looks at the content. Link to comment Share on other sites More sharing options...
Synook Posted December 11, 2007 Share Posted December 11, 2007 Also, I always wondered what do search engines do when they encounter the link with the querystring (<a href="?lang=de">?The robot will be able to append the rest of the URL onto that, so if it is at http://www.mydomain.com/ and the link is to ?lang=de then it will augment them and get http://www.mydomain.com/?lang=de , go to that page and read it. Link to comment Share on other sites More sharing options...
kurt.santo Posted December 12, 2007 Author Share Posted December 12, 2007 Thanks for both your inputs. Good to know!Also, with regard to the lookup table it sounds like to much work for this site, but if I need to do sth like this in future how would I check in lookup table from my pages?Kurt Link to comment Share on other sites More sharing options...
justsomeguy Posted December 12, 2007 Share Posted December 12, 2007 You need to organize the table however you want to look things up, so maybe by page and by language. So it will be a multidimensional array where you can look up a value with the other two values. $lookup = array();$lookup['index.php']['en'] = 'index_en.php';$lookup['index.php']['de'] = 'index_de.php';$lookup['index.php']['fr'] = 'index_fr.php';$lookup['contact.php']['en'] = 'contact_en.php'; etc, however you want to set it up. Then you would check $lookup[$page][$lang] to see what to use. Link to comment Share on other sites More sharing options...
kurt.santo Posted December 13, 2007 Author Share Posted December 13, 2007 You need to organize the table however you want to look things up, so maybe by page and by language. So it will be a multidimensional array where you can look up a value with the other two values.$lookup = array();$lookup['index.php']['en'] = 'index_en.php';$lookup['index.php']['de'] = 'index_de.php';$lookup['index.php']['fr'] = 'index_fr.php';$lookup['contact.php']['en'] = 'contact_en.php'; etc, however you want to set it up. Then you would check $lookup[$page][$lang] to see what to use. Cheers. Will give it a go to see how it works. Might be very useful for anohter project...Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.