Echo and language

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
legoman69
Forum Newbie
Posts: 13
Joined: Fri Feb 24, 2006 10:34 am

Echo and language

Post by legoman69 »

Hi again,
How can I use different languages with the echo command?
For example if I write

Code: Select all

echo "something in Greek language";
it doesn't give the output in Greek..
Any help?

thx
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

When there is something written in Greek it will be Greek:

echo κλέπτης

:wink:
Last edited by neophyte on Sun Mar 05, 2006 10:18 pm, edited 1 time in total.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

What do you mean it doesnt echo. It should echo everything between the quotes if there is somthing there.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

gettext() maybe? PHP won't magically translate your output to another language by default.
hcy
Forum Newbie
Posts: 3
Joined: Sun Mar 05, 2006 11:59 pm

I think

Post by hcy »

when you write "echo "something in Greek language"; " if php can give the output in Greek.. ,the php mustn't php,it must a man or a woman.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: I think

Post by Chris Corbyn »

hcy wrote:when you write "echo "something in Greek language"; " if php can give the output in Greek.. ,the php mustn't php,it must a man or a woman.
Stop this now.... You're contributing absolute junk to all our threads.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

So basically you want a translator? You would need a database with every single word. Or you can just write the words in greek.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

every single word does not work because of crazy grammer in some langauges. what i have always done is just make a giant array of all the phrases that are used and just call a function to it like lang('I translated this') and then in the function lang just base what language you are going to use on what their session is.
Post Reply