Gerard
Gerard

Reputation: 13

grails split i18n files (messages.properties)

I would like to split the messages.properties into several files, for example one will contain the validation messages, while the other the text for the FAQ or ToS.

I've been searching and I found this website: http://mrhaki.blogspot.com.es/2011/03/grails-goodness-splitting-i18n-message.html

But it didn't work.

It's possible to accomplish this, or I'm just losing my time?

Thanks in advanced.

Edit: I'm using Grails 2.3.0

Upvotes: 1

Views: 887

Answers (2)

Athlan
Athlan

Reputation: 6609

@Gregg, thank you for hint.

By the way, to keep good structure in project, you can also nest i18n files in subdirectories, like this:

grails-app
|--i18n
|--|--en_US
|--|--|--messagesUserProfile_en_US.properties
|--|--|--messagesRegistration_en_US.properties
|--|--|--messagesCommon_en_US.properties
|--|--pl_PL
|--|--|--messagesUserProfile_pl_PL.properties
|--|--|--messagesRegistration_pl_PL.properties
|--|--|--messagesCommon_pl_PL.properties

Upvotes: 2

Gregg
Gregg

Reputation: 35864

In the i18n folder, I've created customValidation.properties and view.properties. Works fine for me. You have to adhere to the conventions which is keep them in the i18n folder and you can't have underscores in the names except to denote locale.

Upvotes: 3

Related Questions