Re: language files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,
Glad that you replied coz you would have had more experience with this than
the average php joe being the author of a forum.

Isnt your approach a lot like this one:
>  $get_user="Enter your username:";
>  $get_pass="Enter your password:";
except that you are using arrays?

have you ever double entered the same words?
eg:
$lang['login_username']                =        'Username: ';
$lang['login_password']                =        'Password: ';
.... (much further down)
$lang['login_username']                =        'Enter username: ';

and using the above method I bet that sometimes the key in the array gets
pretty big (if you are trying to put a hint of the context in too)...correct
me if i'm wrong, i'm just guessing here.

The problem I feel is, when you are making the script everyhing is fresh in
your mind and you are unlikely to make silly mistakes like the example one
above, but come back to a script after a few months and its an entirely
different story, esp if you have been working on other projects in
between...

Your thoughts....

Cheers,
Ryan


On 4/7/2005 4:46:18 AM, James Williams (php@xxxxxxxxxx) wrote:
> Ryan A wrote:
>
> > Hey,
>
> > I was just wondering which is the best/most efficient way of having
> language
>
> > files for a site?
>
> >
>
> > eg:
>
> > if $lang=english then it should include lang.en.inc.php
>
> > if $lang=swedish then it should include lang.se.inc.php
>
> > etc
>
> >
>
> > One way I did it before was to have an array like so:
>
> > $lang_en[0]="Enter username";
>
> > $lang_en[1]="Enter password";
>
> > etc
>
> > and then in the main php files I include the above language files and in
> the
>
> > print/echo statements I echo $lang_en[x].
>
> >
>
> > It works quite well but just looking at the code its quite easy to get
>
> > confused because of all the $lang_en[x] statements...and you have to
>
> > constantly check the language file and the array number to know whats
> where,
>
> > I though of using short workds like
>
> >
>
> >  $get_user="Enter your username:";
>
> >  $get_pass="Enter your password:";
>
> >
>
> > but then sooner or later you are going to use



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.4 - Release Date: 4/6/2005

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux