2
我不想在config.groovy中硬編碼'training.defaultStartTime'值而是必須從message.properties中讀取它,結果將如此如何從config.groovy中的message.properties中讀取消息
在message.properties
dev.training.defaultStartTime = 09:00
prod.training.defaultStartTime = 10:00
在Config.groovy中
environments {
development {
training.defaultStartTime = message of code 'dev.training.defaultStartTime' in message.properties
}
production {
training.defaultStartTime = message of code 'prod.training.defaultStartTime' in message.properties
}
}
爲什麼message.properties而不是硬編碼Config.groovy文件呢? – 2012-07-25 08:10:10
爲了國際化的目的,我想使用message.properties.I有許多默認值,這些默認值對於不同的國家是不同的 – n92 2012-07-25 08:14:00
但是這些將在應用程序啓動時加載,並且不會與查看站點的用戶的位置有關。 – 2012-07-25 08:16:45