Jump to content

Making a site with multi languages


graham23s

Recommended Posts

Hi Guys,

 

i have done a site ok, but someone was asking about multi language support (i know id need to translate every word into another language) but what would be the best way about it put the english word and the forein words in a constants file?

 

cheers

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/64568-making-a-site-with-multi-languages/
Share on other sites

U should consider site lang and articles lang. The site langs may be in different files, each of them having the same variables or arrays and depending on the user's choice, u include the specific lang file ex:

 

eng.lang.php

$lang['title'] = 'This is my site';
$lang['desc'] = 'My site is good';

 

In that way u can have the other languages. About articles then, if ure using databases, u may have another table with the same columns as the english table. Finding out wich language is set may be done with sessions (or cookies if u want to remember what the user's last lang was) and depending on the session value, u include the right lang file and select the right db tables. Guess its clear, but if not ask again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.