This is tricky because it depends on the language, and it's hard to know 
what language a name is encoded in. It's not necessarily the language of 
the current localization, which is what __() would be expected to use.

I ended up adding a language column to my names table and then writing a 
custom function that assembles the name according to the language. (It's 
not just asian languages such as Chinese, Japanese, and Korean, but also 
european languages such as Hungarian, AIUI.)

As a side note, to avoid confusion I would call the fields "given" and 
"family", not "first" and "last".

On Thursday, August 21, 2014 11:31:09 AM UTC-4, Justin Atack wrote:
>
> Hi All,
>
> As we know in some languages (Chinese) the order of a persons name is 
> family name, first name.
>
> How do we handle this for translation of strings. I need to be able to 
> allow translators to switch the order depending on language.
>
> Here is a way I have found to do it but I don't really like it. I would 
> prefer if there was a Cake way I could use.
>
> <?php 
>     $first_name = $student['Student']['first_name'];
>     $last_name = $student['Student']['last_name'];
> ?>
> <h1><?php echo __("$first_name $last_name"); ?></h1>
>
> I came across the String::insert feature but I don't think it can be used 
> in views and with the __() function?
>
> I look forward to your input
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

Reply via email to