Jump to content

Best Way To Create Multi Language Website


Dr-SeMSeM
 Share

Recommended Posts

Hi all ,currently im planning with a friend to create multi language websiteAIM :depend on regisration of the website and chose the default language .. and then to manage his owen saved texts on the website thats mean every member will have his owen saved notes or calendar ... so , what is the best way to create it under multi language and by the way ..how to create add language function to add more in the future ?im thinking in the next :to make language files inside folders ( such as IPB software ) and create it basically on another language ..then we translate it manually .... and the skin will be standard and may change some features .. such as chosing a skin with the language ... etc fainally : What is your advise to start the project correctly ... thanks for advance

Link to comment
Share on other sites

For the languages, the easiest way is to put all text strings that you want to translate into an include file for each language. The file should just define all of the text variables. When they call up a page, you figure out which language to use and include the appropriate file first, then when you write out the page you use the variables for the text strings. e.g.:

<?php$lang = array();$lang['welcome'] = 'Welcome!';$lang['login_prompt'] = 'Enter your username and password below.';$lang['login_username_error'] = 'The username was not found.';...?>

<?phpinclude 'languages/en.php';echo $lang['welcome'];...?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...