Good question. I'll tell you my hack, however I'd be really curious to hear
other people's opinions as well.
For text without links I do something similar to the phpMyAdmin way, however
I put my language into an array, just so that if I use language inside of
functions I don't have to declare each variable as a global, just the one
array. For example (using romanji for the Japanese for non-Japanese enabled
mail clients on this list):
$lang = array(
"verify" => "kakunin",
"name" => "namae",
"no" => iie",
"delete" => "sakujo,
"close_window" => "tojiru"
);
Then, when I want to use it in a function I just use "global $lang" and I
can use the bits that I want (i.e. <?php print($lang[name]); ?>
For pieces that are a bit more complex, such as phrases that contain links
or bolding or other attributes that might not line up because of the
differences in expressing English and Japanese, I use functions:
function lang_show_result($start,$finish) {
$txt = "Showing results $start-$finish.";
return($txt);
}
> It's very nice to see some activity on here from this end of the mailing
> list as well. I am on the verge of putting together a php/mysql
> multilingual website from scratch and it's good to know that some people
> are reading up on the list. I was wondering what people's opinion on
> the overall structure of a multi language php application is. There are
> a number of ways to implement the frontend.
>
> 1. Do something similar to the way phpMyAdmin works and have different
> files layed out with the different encoding types and variables listed
> for each message displayed to the users.
>
> 2. Use gettext or some other widely used standard.
>
> ..... Etc..
>
> Of course even these 2 solutions have their good and bad points. The
> first is quick but harder to maintain. The second of course is easier
> to maintain but more difficult to setup from the beginning. What do
> others think or what are they using at this time?
>
> Thanks,
> -jeff
- AV
--
PHP Internationalization Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php