[katello-devel] Translation strings with ruby code

jesus m. rodriguez jesusr at redhat.com
Fri May 20 12:51:36 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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?
> 

It this really a concern? Shouldn't we verify the strings when the
come back before pushing out a release? Wouldn't this be verified
in testing both functional and unit?

I fear we'll be making a change to prevent a problem that may never
occur or could be preventable in other ways than changing how we
code.

Just my 2 pesos.

- -- 
jesus m. rodriguez          | jesusr at redhat.com
principal software engineer | irc: zeus
red hat systems management  | 919.754.4413 (w)
rhce # 805008586930012      | 919.623.0080 (c)
+---------------------------------------------+
|   "Those who cannot remember the past       |
|    are condemned to repeat it."             |
|                        -- George Santayana  |
+---------------------------------------------+

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk3WY9gACgkQvJZ57YntiYN0FACfSHGAcDjCEgSgmWmnfUUeVWVF
2ygAn0s32/SoIPfAfc55WTqIuKaUoI1q
=nAca
-----END PGP SIGNATURE-----




More information about the katello-devel mailing list