Page 1 of 1

Simple langauge script?

Posted: Fri Nov 15, 2002 4:19 pm
by DanX
Does anyone know a good method to setup a decent language management script? Before I was using something like

Code: Select all

<?php
$txt1 = 'you';
$txt2 = 'me';
?>

but if I wanted to add something before me, it's a pain to do, if I'm using a number system.. so does anyone have a better idea?

Thanks.

Posted: Fri Nov 15, 2002 5:04 pm
by MeOnTheW3
Use an array?

$txt['me'] = 'e';
$txt['you'] = 'f';
$txt['us'] = 'a';


Really don't know what you are tring to do, though. But if you are triing to manage first and third person respective to n parties, try a multi dimensional array:

$lang['me']['first'][1] = 'I';
$lang['me']['first'][2] = 'me';
$lang['me']['first'][3] = 'mine';
$lang['me']['first'][4] = 'ours';
$lang['me']['third'][1] = '$MyName';
$lang['me']['third'][4] = 'theirs';
$lang['you']['first'][1] = 'you';
$lang['you']['first'][3] = 'yours';
$lang['you']['third'][1] = '$YourName';


make any sense, post more of the challenge more better help with a solution.