PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 11th, 2002, 07:25 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Many languages

i would like to implement multi language option for my scripts.Like, when the user clicks on the english, the pages are viewed in english and if in french, they are viewed in that language.For instance, i have settings on my navigation bar and when i click on that, a php page is opened.Inside this php page, i included some .ini files.Now, i want these ini files to be displayed in the language chosen.For this, i created a table called language, added all those .ini modules and their corresponding text phrases in the 2 different languages.

How can i proceed further??
Thanks in advance for all your suggestions.

Reply With Quote
  #2  
Old July 11th, 2002, 08:47 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Many languages

..have you seen this thread?

Reply With Quote
  #3  
Old July 12th, 2002, 05:08 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Many languages

Hello Notepad,

That did not serve me any purpose.
could you give me any idea.

thank you

Reply With Quote
  #4  
Old July 12th, 2002, 06:33 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Many languages

sorry, i don't follow

Reply With Quote
  #5  
Old July 12th, 2002, 10:41 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Many languages

Hello notepad

I was asking you about multi language concept and you have given me the link for previously asked threads.Those threads were not so useful.could you give me an example or any other idea.

thank you

Reply With Quote
  #6  
Old July 12th, 2002, 10:57 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Many languages

Sorry I'm not sure what you're asking. You were curious about the "concept" of multi-language pages and the previous thread i linked gave some concepts of how it worked. I thought it would help.

Maybe somebody else has an idea?

Reply With Quote
  #7  
Old July 13th, 2002, 09:31 AM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: Many languages

What does your table look like?

You could set a session variable telling the system what language to get - so if $lang = "english" then SELECT ini FROM languages WHERE language='$lang'?

Then you simply print out those results? Am i on the right track?

Reply With Quote
  #8  
Old July 15th, 2002, 10:54 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Many languages

Hello dats,

herez my table how it look like:

lan_id
lan_field (in order to use in the code)
lan_module (the .ini files)
lan_english(text phrases in english)
lan_french(text phrases in french)

could you pls give me the start up


Reply With Quote
  #9  
Old July 15th, 2002, 12:15 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: Many languages

what data will be contained in the fields? I note you're saying "phrases in english/french".. do you have name of the ini file in lan_module, the english interpretation in lan_english and french interpretation in lan_french?

If so, simply set $lan = "french"; or $lan = "english"; and run something like : mysql_query("SELECT lan_$lan FROM table WHERE lan_module=$module");

Is that what you're looking for?

Reply With Quote
  #10  
Old July 16th, 2002, 01:11 PM
Taoism Taoism is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Winnipeg, MB, Canada
Posts: 81 Taoism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 2
RE: Many languages

Quote:
i would like to implement multi language option for my scripts.Like, when the user clicks on the english, the pages are viewed in english and if in french, they are viewed in that language.For instance, i have settings on my navigation bar and when i click on that, a php page is opened.Inside this php page, i included some .ini files.Now, i want these ini files to be displayed in the language chosen.For this, i created a table called language, added all those .ini modules and their corresponding text phrases in the 2 different languages.

How can i proceed further??
Thanks in advance for all your suggestions.


There are several ways to approach this. And it really depends specifically on your needs and or application constraints.

For example, you will probably default the site to a language (english)? And upon the first time browsing the site, the user can select the viewable language. You can then set a semi-permanent cookie with their preferred language and every time they visit the site, as part of the page rendering you check to see if the language cookie is present and render in the selected language if it is.

What if you can't write a cookie that is permanent? That is what I have to deal with where I work. Fortunately, the person who originally set up the website used a directory structure that maps to a different sub-directory based on language. So, I simply read the URL the user is browsing to and if the URL contains the directory that the french version would go into I render in French, and likewise I do a check for english and render in english. Because this can be a problem (now two copies of the website to upload). I set up the code so that it is identical and the only difference is how the language is loaded. This allows me to maintain one copy of the website code in the repository and upload it to both subdirectories and have it work well.

All that because we can't use a permanent cookie, and we don't want to have a language toggle variable in the URL string. Sheesh

Cheers,
Keith.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Many languages


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway