Jump to content

Change of file name


kurt.santo
 Share

Recommended Posts

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

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

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...