I have some 40 variables defined like:--
add_notice_sender = "You added %s to the %s group."
add_notice_everyone = "%s added %s to the %s group."
accept_everyone = "%s has joined the %s group."
I will be replacing %s with values in various places may be in controller or model or delayed 开发者_开发技巧job. How can I create a single file for these kind of variables and use it from there only. I don't want to place it here and there in whole application.
- I tried in initializers directory but delayed job is not accessing it.
- I tried placing it in a file under lib directory. still no luck.
From Benoit Garret's comment:-
config/locales/en.yml and the I18n is the right place to have these kind of variable declarations.
精彩评论