ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
Improve I18n syntax deprecation warning (Feature #394)
Description
The current implementation of the i18n deprecation warning is not very helpful to actually find the offending line. The given line number within the warning is always in config/initializers/...
.
The attached pull request changes that. Instead the top most stack frame is given, that resides inside Rails.root. Also there is now a separate warning for every offending line, while a single line is not reported twice.
The changes should make it easier to actually find the places, where the deprecated behavior is used.
History
Updated by Gregor Schmidt at 2011-05-13 10:29 am
Pull request is at https://github.com/chiliproject/chiliproject/pull/52
If 1.4 will happen, this might be a useful improvement.
- Assignee deleted (
Gregor Schmidt) - Status changed from Open to Ready for review
Updated by Eric Davis at 2011-05-13 04:37 pm
So would this print out the offending line of code (.rb
) or translation (locales/*.yml
)?
Updated by Gregor Schmidt at 2011-05-13 04:46 pm
It's the line in the ruby file. But that would hopefully be a good hint.
We were having problems with the original warning. I checked all locale files twice and none was using the old curly braces anymore. Only with the help of the changed warning, I was able to find that Rails 2.3.5's ActiveRecord::Error#full_message
is internally using curly bracket interpolation. That was the actual motivation for the pull request.
Updated by Felix Schäfer at 2011-05-14 03:58 pm
That being an edge case and not needed anymore with rails 2.3-latest/ChiliProject 2.0, I'm not sure we really need it on 1.x anymore.
Updated by Eric Davis at 2011-05-27 03:57 pm
I tested this but I couldn't get any message logged at all.
- Patch locales/en.yml to use the old style:
label_user_activity: "'s activity"
- Loaded the per user activity feed.
- Old code showed the deprecation warning. With this patch, no deprecation warning is shown at all.
I'm thinking we just skip this for 1.4.0, since that branch is almost done anyways (i.e. 2.0 doesn't have this issue)
- Target version deleted (
1.4.0) - Assignee set to Eric Davis
- Status changed from Ready for review to Needs more information
Updated by Gregor Schmidt at 2011-05-27 06:54 pm
That's strange. I am running into the same problem. But when using Shift-Reload in the browser, the warning is emitted properly. While running your example, I realized, that the warning could still be improved. I think, this is still a useful improvement for everybody trying to upgrade plugins and such.
When I manage to fix it properly, we could point people here to find more debugging help.
- Assignee changed from Eric Davis to Gregor Schmidt
- Status changed from Needs more information to Open
Updated by Felix Schäfer at 2011-10-03 09:51 am
Closing this as we're way past 2.0.
- Status changed from Open to Declined