[katello-devel] Translation strings with ruby code

Bryan Kearney bkearney at redhat.com
Fri May 20 12:17:19 UTC 2011


On 05/20/2011 08:10 AM, Lukas Zapletal wrote:
> Hey,
>
> we often have strings with some ruby code, e.g.
>
> "bla bla #{some_variable}"
>
> I did not test this, but I guess these strings get extracted via gettext
> including the ruby code. If we use some online translation service in
> the future we might get into troubles.
>
> "bla bla #{User.create(name => 'cracker', is_admin => true)}"
>
> To improve security I'd suggest to use the pythonic string formatting:
>
> N_("bla bla %s" % [some_variable])
>
> This could be also less cryptic for our translation teams and it could
> prevent typos introduced into the code with auto-translating tools.
>
> Comments?
>
Is there a form where we can use positional %0, %1, etc? That way the 
translaters can move around the string.


-- bk




More information about the katello-devel mailing list