On 14-Mar-01 Tao wrote:
> Kevin,
> 
> Thanks for the reply.  This will not solve my problem.  The problem is, for
> some
> languages the sentence structure may be different.  For example, the
> sentence
> may need to be,
>     $greeting = "$first_name, welcome!"
> as opposed to,
>     $greeting = "Welcome, $first_name!"
> 
> Or, it can come in a different form, like,
>     $greeting = "Good morning, $first_name."
> 
> These specificity need to be in the language file, not the scripts.
> 
> Tao
> 

I use a MySQL table to localis(z)e both words & printf formats:

+-------+------+----------------+-------------------+
| catid | lang | strid          | strval            |
+-------+------+----------------+-------------------+
|       | de   | Statistics for | Stand vom %s      |
|       | de   | Statistics     | Statistik         |
|       | sv   | Statistics     | Statistik         |
|       | en   | Statistics for | Statistics for %s |
|       | en   | Statistics     | Statistics        |
|       | sv   | Statistics for | Statistik för %s  |
+-------+------+----------------+-------------------+

+-------+------+---------------+----------------------------------------+
| catid | lang | strid         | strval                                 /
+-------+------+---------------+----------------------------------------+
|       | en   | Topsignupurls | Top %d signup URL's for %s             |
|       | de   | Topsignupurls | Ãbersteigen Sie %d signup URL's für %s |
|       | sv   | Topsignupurls | Topp %d försäljnings URLs  för %s      |
+-------+------+---------------+----------------------------------------+

If the phrase structure is likely to be different, you store the printf
specification as well. example:

    body_beg(SITENAME.' '.nls('Statistics')); // title & open body
...
    $ds=formatdate($dte);                     // localized date string
...
    printf('<H5>' .nls('Statistics for') ."</H5>\n", $ds);
...
    printf('<H5>'.nls('Topsignupurls').' </H5>', 30, $ds);

Regards,
-- 
Don Read                                         [EMAIL PROTECTED]
-- If you are going to sin, sin against God, not the bureaucracy. 
                  God will forgive you but the bureaucrats won't. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to