Show: Leverage Scala Macros to make compilation fail for invalid i18n key or invalid i18n arguments

Our team have recently come up with a way to make compilation fail when an invalid key or invalid arguments are provided for Playframework’s i18n. It saves us headache when there are ~1,000 translation keys in our project. So, we would like to share it with you all.

Here’s the full blog post:
Here’s the full working example:
Here’s the Macros code:

TL;DR we use Macros to read conf/messages and check all translation method invocations at compile time.

1 Like