Cannot get i18n message resolved on a config page

21 views
Skip to first unread message

Kirill

unread,
Nov 12, 2015, 10:48:00 AM11/12/15
to Jenkins Developers
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.

Oleg Nenashev

unread,
Dec 1, 2015, 12:00:28 PM12/1/15
to Jenkins Developers
Is the problem still actual?
If yes, check that your messages are located in src/main/resources/<my.java.
package>/MyBuildStep/config.properties . Only this file is being included by default


четверг, 12 ноября 2015 г., 18:48:00 UTC+3 пользователь Kirill написал:

Daniel Beck

unread,
Dec 1, 2015, 12:40:00 PM12/1/15
to Jenkins Developers
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.
> --
> 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 jenkinsci-de...@googlegroups.com.
> 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.

Reply all
Reply to author
Forward
0 new messages