Check at compile time that for each Messages("myKey") there is a defined "myKey" in each messages.xxx

42 views
Skip to first unread message

kheraud

unread,
Feb 8, 2016, 11:53:02 AM2/8/16
to play-framework
Hello,

I need to be sure at compile time that every Messages("myKey") will be translated to a real message for every language available ("play.i18n.langs").

I used to look for that with a custom script based on regular expressions. As my project is becoming bigger, I am looking for something more solid I can have confidence in.

How would you deal with that ? Is there any sbt plugin you have heard of which could do that ?

Best regards,

Karim

Will Sargent

unread,
Feb 8, 2016, 1:21:15 PM2/8/16
to play-fr...@googlegroups.com
Hi Karim,

It's not MessagesAPI compatible, but I think that Rapture will do this:


There's also CAL10N:


Will.


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ac56b6bf-91cc-4c21-805d-9fd8dbd23fc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ngoc

unread,
Feb 10, 2016, 8:12:08 PM2/10/16
to play-framework
You can automatically extract all i18n keys in your program with this tool:
https://github.com/georgeOsdDev/play-xgettext

Then compare the output with the translated messages you have.

Evan Bennett

unread,
Feb 11, 2016, 12:37:34 AM2/11/16
to play-fr...@googlegroups.com
If you are using Play 2.3, this should meet your goal(s), but requires a source code change (which should be able to be performed by 1 regex update across the project):


I am pretty sure it can no longer access the configuration values in Play 2.4, which I was unable to resolve. But the idea of creating static references and comparing the messages files still works.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/ac56b6bf-91cc-4c21-805d-9fd8dbd23fc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
  Evan Bennett
  BInfTech(DataCommunications&SoftwareEng)(QUT) MACS
Reply all
Reply to author
Forward
0 new messages