Generating English properties files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating English properties files

Eric Lefevre-Ardant
All,

I've been (slowly) working on internationalizing a few jelly files. This includes a number of properties names (step.1, step.2) that have to be translated into English.

I duly run "mvn stapler:i18n -Dlocale=fr" to generate French properties.

Question is: can I do the equivalent for the default properties (English, but no extensions) or do I have to type the properties manually? I tried "mvn stapler:i18n -Dlocale=" and " "mvn stapler:i18n", but that didn't work.

Thanks!

Eric
Reply | Threaded
Open this post in threaded view
|

Re: Generating English properties files

Simon Wiest
Eric Lefevre wrote on 23.07.2008 19:37:

> I've been (slowly) working on internationalizing a few jelly files. This
> includes a number of properties names (step.1, step.2) that have to be
> translated into English.
>
> I duly run "mvn stapler:i18n -Dlocale=fr" to generate French properties.
>
> Question is: can I do the equivalent for the default properties
> (English, but no extensions) or do I have to type the properties
> manually? I tried "mvn stapler:i18n -Dlocale=" and " "mvn stapler:i18n",
> but that didn't work.

The keys in the jelly files serve a twofold mission:
1.) They act as resource keys used for localization.
2.) They represent the English translation.

Because of 2.) no further English property file is required - but you
can create one optionally, e.g. "foobar.properties" (note the missing
locale suffix). In this file you can assign comprehensive English texts
to "symbolic" keys found in the jelly file, like "step.1".

As Stapler cannot determine which keys are complete English texts and
which keys are just symbolic names like "step.1", you'll have to create
the English properties files manually and add the latter one by one.

See the key "body" as a real-world example in
main/core/src/main/resources/hudson/model/Hudson/projectRelationship-help.jelly.

Hope that helps, cheers,
Simon.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Generating English properties files

Kohsuke Kawaguchi
Administrator
Simon Wiest wrote:

> Eric Lefevre wrote on 23.07.2008 19:37:
>> I've been (slowly) working on internationalizing a few jelly files. This
>> includes a number of properties names (step.1, step.2) that have to be
>> translated into English.
>>
>> I duly run "mvn stapler:i18n -Dlocale=fr" to generate French properties.
>>
>> Question is: can I do the equivalent for the default properties
>> (English, but no extensions) or do I have to type the properties
>> manually? I tried "mvn stapler:i18n -Dlocale=" and " "mvn stapler:i18n",
>> but that didn't work.
>
> The keys in the jelly files serve a twofold mission:
> 1.) They act as resource keys used for localization.
> 2.) They represent the English translation.
>
> Because of 2.) no further English property file is required - but you
> can create one optionally, e.g. "foobar.properties" (note the missing
> locale suffix). In this file you can assign comprehensive English texts
> to "symbolic" keys found in the jelly file, like "step.1".
>
> As Stapler cannot determine which keys are complete English texts and
> which keys are just symbolic names like "step.1", you'll have to create
> the English properties files manually and add the latter one by one.
Yep.

I think I should extend the IntelliJ stapler plugin to support this
internationalization operation for Jelly and not just for Java code.

It would make this effort, far, far more productive.

> See the key "body" as a real-world example in
> main/core/src/main/resources/hudson/model/Hudson/projectRelationship-help.jelly.
>
> Hope that helps, cheers,
> Simon.
>


--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment