04-17-2008, 05:01 PM
|
#4 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by khile
well basicaly i want the program im making to use launage packs and i know both english and german and i have made the function that puts the launage on end of url but not sure of the code i should put in to show either English (en) or German(de)
like
on the status.php if its en it goes to en section of that and displays infomation thats under the en part of the document
|
I think you should make an array of words for both languages, so you can do a string replacement using a foreach on the whole document.or a preg replace, whatever. Cause a foreach takes all the words from that array, and replaces the document's characters with the arrays one. whatever, understand me? :P
You can do this by functions aswell, so you can do for exmaple in mysql:
PHP Code:
lang($row->msg);
And this would replace it with whatever is in the $GET var, so if it isn't even defined in the $GET var yet, you can do
PHP Code:
if (empty($_GET['check_status_lang'])) $_GET['check_status_lang'] = 'en';
This sets the session, now if it's different, then it changes the session to german, thus it's back and forth.
default session to english. and if it's changed, then it changes the session.
__________________
VillageIdiot can have my babbies ;d
|
|
|
|