Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php language enabling
Old 02-28-2008, 09:05 AM php language enabling
Junior Talker

Posts: 1
Name: BARKAVI
Trades: 0
Hi,
i want to enable English and German in my php project, how can this be done, can any one help me, its urgent work.

sincerely,
barkavi
barkavi is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-28-2008, 02:33 PM Re: php language enabling
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Sure:

PHP Code:
if($client_language == "german"){
// Do german version of site.
} else {
// Do english

Or do some nice folder structure, for example
site.com/en/index.html
site.com/ja/index.html

Also see:
http://gtk.php.net/manual1/en/html/t...anslation.html
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 02-28-2008 at 02:37 PM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 02-28-2008, 03:54 PM Re: php language enabling
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
site.com/de/index.html not ja, ja is for Japan, de is for the Deutsch.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 02-29-2008, 01:40 AM Re: php language enabling
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
What I've seen done before is storing all of your outputs in an associative array, it is easier to explain in code:
PHP Code:
$language getLanguage(); //I won't define this function as it is trivial... its just a way of getting a user's preferred language

echo $langauge['header'];
echo 
$langauge['content'];
// etc 
Just build several arrays that can all be accessed in the same way, but each stores the output in a different langauge. This way you don't have to create multiple files or directories.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to php language enabling
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.48708 seconds with 12 queries