View Single Post
  #4 (permalink)  
Old 08-30-2008, 12:02 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 10,868
Last Blog:
Artificial Intelligenc...
Credits: 1
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default Re: Multi-lang. option in a cms

Yup, that looks just like Joomla.

So, say you have an option in your CMS to choose English or French. You have 2 files in your language directory (english.php and french.php). If the user selects English your CMS includess the english.php file. If the user selects French it includes french.php.

The English file contains:
PHP Code:
define("_TURNOFFMSG","Turn Off Public Messages"); 
The French file contains:
PHP Code:
define("_TURNOFFMSG","Désactiver les messages publics"); 

In your CMS where you would normally do this:

PHP Code:
echo "Turn Off Public Messages"
you would change it to

PHP Code:
echo _TURNOFFMSG
Now, depending on what the user has selected it will output the named constant in English or French.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Reply With Quote