|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
RE: Many languages
..have you seen this thread?
|
|
#3
|
|||
|
|||
|
RE: Many languages
Hello Notepad,
That did not serve me any purpose. could you give me any idea. thank you |
|
#4
|
|||
|
|||
|
RE: Many languages
sorry, i don't follow
|
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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? |
|
#7
|
|||
|
|||
|
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? |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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? |
|
#10
|
|||
|
|||
|
RE: Many languages
Quote:
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. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Many languages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|