[katello-devel] Translation strings with ruby code

Lukas Zapletal lzap at redhat.com
Fri May 20 12:10:40 UTC 2011


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?

-- 
Later,

  Lukas Zapletal | E32E400A
  RHN Satellite Engineering
  Red Hat Czech s.r.o. Brno




More information about the katello-devel mailing list