localization

Bryan Kearney bkearney at redhat.com
Thu Apr 15 17:01:55 UTC 2010


Cool.. couple of questions:

On 04/15/2010 12:38 PM, Dmitri Dolguikh wrote:
> changes are in. Here's the skinny:
>
> - there's a new dependency in the build: gettext-commons
> - there are new targets in the build: extractkeys - extracts strings
> that need to be localized, mergekeys - performs a merge on the existing
> .po files, createresourcebundles - compiles resource bundles
> - localized resource bundles can be found in
> localized_resources/classes/ directory

Is there a way to identify the keys which have not yet been translated?

> - if you're running tomcat from under eclipse, you'll need to the above
> directory into tomcat's classpath
>
> how to use it (development):
> inject I18n (there's a I18n provider) instance in the classes that will
> have user-visible text. Then (assuming instance variable name is i18n):

I assume still open to do is to yank the locale off of the current request?

>
> <snip>
> i18n.tr("goodbye, cruel world.");
> </snip>


So. best practice is to use tr("string with {0}", variable) ??

Also... I assume since it is scanning for .tr() we can not put the i18n 
into the actual exception class?

I doubt we could do BadRequestExcepotion.tr("Some text"). Seems like a 
hack :)

-- bk



More information about the candlepin mailing list