Discussion:
Translating to a different language than the one installed
David Anderson
2013-12-21 10:41:22 UTC
Permalink
Hi,

I'm currently working on a plugin that sends back an informational
message to a remote (WP) site.

The remote site's language might not be the same language as the remote
site.

So, it seems that I need to locally translate the string to a different
language than the one installed.

Alternatively, that might be the wrong solution; perhaps the translation
should be done on the remote site, instead (so, the remote site would
maintain a list of message codes, to be translated to strings).

Anyone got experience of this? If I did decide to try to translate
locally, then is that even possible without gross hacks? (I think that
translating on the local side might be preferable, because on the remote
side, it's going to be plugins that developers build themselves using a
toolkit I supply them, and I want to minimise the amount of work they
have to do - though, I suppose, my 'toolkit' could have its own text
domain and keep its translations separate, so that the developer won't
have to fiddle with anything there).

Thanks for any insights!

Best wishes,
David
--
UpdraftPlus - best WordPress backups - http://updraftplus.com
WordShell - WordPress fast from the CLI - http://wordshell.net
Ryan McCue
2013-12-21 15:14:48 UTC
Permalink
Post by David Anderson
Hi,
I'm currently working on a plugin that sends back an informational
message to a remote (WP) site.
The remote site's language might not be the same language as the remote
site.
So, it seems that I need to locally translate the string to a different
language than the one installed.
Alternatively, that might be the wrong solution; perhaps the translation
should be done on the remote site, instead (so, the remote site would
maintain a list of message codes, to be translated to strings).
If you can keep a list of all possible strings locally (that is, you
know what the other end is outputting), then ideally you'd use noop'ed
translations.

Unfortunately, we don't have noop translations for non-plural strings.
You can fake it by just using the same string twice, of course. Then,
just pass it to translate_nooped_plural() after retrieving the result.
--
Ryan McCue
<http://ryanmccue.info/>
Loading...