Skip to content

Commit

Permalink
Adding the file system for ( translate and localization ) our website
Browse files Browse the repository at this point in the history
  • Loading branch information
AJ-7885 committed Apr 24, 2014
1 parent d8a7e9d commit d13a92b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/lang.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<?php
// Build 2D array to hold the lang , keyword to use in our application and relate langauges .

$lang=array(
// First Langauges
'en'=>array(
'hello'=>'Hello',
'my_name'=>'My name is ',
'username'=>'Username'
)
// Second Languages
,
'pn'=>array(
'hello'=>'سلام',
'my_name'=>'اسم من هست ',
'username'=>'کلمه زمز'
)
// Third Langages
,
'fr'=>array(
'hello'=>'Bonjour',
Expand Down
6 changes: 5 additions & 1 deletion lang_test.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php
// This is only for test propose to check out translate process is working fine or not .

//Adding keyword array information
include ('include/lang.php');

//Check get param , if there is not param the default langauge will set to English
$default=(empty($_GET['lang']))?'en':$_GET['lang'];

// Final step is to get the related translat from the selected language by exact keyword .
echo $lang[$default]['hello'].','.$lang[$default]['my_name'];

?>

0 comments on commit d13a92b

Please sign in to comment.