Hi i am devloping sample site in php i need to translate whole website in to persian. how can it possible in php?? I have tried using the following code.. This code will wor
AS per me you can try this method.This method is already implemented in our system and it is working properly.
Make php file of each language and define all the variables and use those variables in pages.
for e.g For english
english.php
$hello="Hello";
persian.php
$hello=html_entity_decode(htmlentities("سلام"));
Now use this variable to page like this.
your_page.php
You have load specific language file as per get language variable from URL.
It is better that you have define this language variable into config file.
config.php
if(isset($_GET['lang']) && $_GET['lang']=='persian')
{
require_once('persian.php');
}
else
{
require_once('english.php');
}