[wp-polyglots] Translating constructed sentences

Nikolay Bachiyski nb at nikolay.bg
Mon Mar 1 07:58:34 UTC 2010


On Mon, Mar 1, 2010 at 01:39, Alex Hempton-Smith
<hempsworth at googlemail.com> wrote:
> Throughout my plugin I'm constructing sentences like this:
>
> ...
>     $action = bp_core_get_userlink( $user_id ) . ' likes ' . $author . ' <a
> href="' . bp_activity_get_permalink($activity_id) . '">activity</a>';
>
> What would be the best way of making this translatable? Something like this
> perhaps:
>
> ...
>         $action = sprintf(__('%s likes their own <a
> href="%s">activity</a>'), $liker, $activity_url);
> ...
>         $action = sprintf(__('%s likes an <a href="%s">activity</a>'),
> $liker, $activity_url);
> ...
>         $action = sprintf(__('%s likes %s\'s <a href="%s">activity</a>'),
> $liker, $author, $activity_url);
> ...
>
> My only worry is that the sentences are almost identical, I don't want
> translators having to do too much repetition.
>

That's the best way. Even if there might me repetition for some
translators, for most of the us the previous version was unusable. Too
many languages with genders, declensions and such.

Happy translating,
Nikolay.


More information about the wp-polyglots mailing list