Messages.properties is only used for string referenced in (Java) source code.

For foo.jelly / foo.groovy views, put your strings into foo.properties in the 
same folder.

On 12.11.2015, at 16:48, Kirill <[email protected]> wrote:

> Hi folks,
> 
> This is probably something very simple, but I cannot get this working.
> 
> I have Messages.properties in the src/main/resources/<my.java.package>. 
> mvn compile creates a <my.java.package>.Messages class that contains all 
> getter methods that return the messages I have put to Messages.properties. So 
> far so good.
> I have an entry "scheduleIsAvailable=Schedule is available" in this property 
> file. So that's exposed as Messages.scheduleIsAvailable(). Peachy.
> 
> Next thing I do is I refer to this constant in Jelly as advised in 
> https://wiki.jenkins-ci.org/display/JENKINS/Internationalization:
> 
> ${%scheduleIsAvailable}
> 
> Guess what? It's rendered as "scheduleIsAvailable" :(
> 
> The Jelly is config.jelly (build step config) sitting in 
> src/main/resources/<my.java.package>/MyBuildStep 
> (src/main/resources/<my.java.package>/MyBuildStep/config.jelly). 
> 
> I would do a workaround exposing smth like getMessage(key) in Descriptor, and 
> would call ${descriptor.getMessage('scheduleIsAvailable')}, but Messages 
> class doesn't provide any way to get message by key...
> 
> Please help!
> 
> Regards,
> Kirill.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/2ab5f860-e0fb-4d00-8de7-62ed08a1e361%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/148B0064-63E8-4D97-B7B1-F062FEBD1BDC%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to