Discussion on [How-To]Multi-language Support to a PHP Website within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
Are you interested in having a multilingual website? This is a tutorial that shows you how you can do that in PHP. The first thing we need to do is to create a couple of files that will contain the text for each of the languages that will be supported by the website. For demo purpose I have chosen English, Spanish and German. Make a directory named “directory”. In this directory create 3 files: lang.de.php, lang.en.php, and lang.es.php. In our main file (index.php) we will include a file (common.php) containing a piece of code that gets the requested language. Here’s the content of those 3 language files:
As you can notice, some constants are created using the define() function. In every file the defined constants have the same name, bu the values is different. We will output the values of the constants inside the index.php file. Therefore we will see different text every time we will call other language file.
Determine the right language
After we determine the value of $lang, we use switch() to compare its value with some different values, and execute a different piece of code depending on which value it equals to. After the value of the $lang_file is determined, the script will include the necessary language file. As you can see I have used sessions to register the value of $lang. This way users can navigate through the whole site and see the content in the chosen language (lang=[language here] does not need to be passed in every URL). Additionally, I have used cookies to store the selected language in users computer for 30 days. When the visitor will come back he will see the site in the language that he previously selected.
How if the website’s language requested?
In this demo I have chosen to use some image flags, each image having a link to index.php?lang=[LANG HERE]. So, to see the site in german we will use the German image flag which links to index.php?lang=de.
Lastly, the constants values should be outputted in the page. Examples:
for document title
Yes, I did not write but do not have the above side epvp The page where you can find it was no longer there because 2 years Description ....
Only this is not what I wrote but was made public.
Only what I have written, and the system you call your own.
Just what I met many pages there are no more language options, and so I published the source code
Then write down that you didn't made the tutorial.
Quote:
Thank you for checking on my topic.
This is clearly misleading. You can get "Thanks" (for whatever you need them) for publishing this tutorial here but make CLEAR that you didn't wrote it.
Then write down that you didn't made the tutorial.
This is clearly misleading. You can get "Thanks" (for whatever you need them) for publishing this tutorial here but make CLEAR that you didn't wrote it.
Alessa, what is your problem? I didn't knew this language thingy, and i'm sure more do. This is helpfull for people which are using an cms or some sort of site. As for you and the other flamers, haters or w.e. Just ignore and shutup?
I'm sorry for my mother because it was trying to help people so ....
I'm sorry for swearing but I hate that kind of thing that, how to connect it to another ...
sorry for the bad translation text.
mybb multi forum website 07/04/2012 - EO PServer Hosting - 0 Replies Dear users
maybe this belongs in the general chat , but as i spend most of my time in here do i think that this is a good place to :D
anyway
most private servers need a forum , i see differend webmasters use a freehost provider and also a free forum
so now i released a new system to get your own mybb forum for free
the script is still in alpha stage , so i am working on it to improve as needed
Website doesn't filter all language? 01/14/2012 - Off Topic - 0 Replies Hello,
Well I've pressed the USA link as I do not speak German and it doesn't filter it all.
Only noticed the main page is filtered and some posts when reading are in English but not alot.
All info etc is German, any idea's?
how to make isro client support multi language type? 07/21/2011 - SRO Private Server - 4 Replies hi all im wondering how to make isro client support multi language input?
like chinese/kr language type thanks everyoneXD
Website Support 06/21/2010 - Technical Support - 3 Replies Hey guys,
I wanna know If someone of you knows how to get such a chatroom:
The Colorless: Chat (Dollars/Durarara!!)
I really want it like this .... like in Durarara but dunno how ......