fractaledmind / solid_errors

database-backed, app-internal exception tracker for Rails applications
MIT License
332 stars 17 forks source link

Suggestion: use default "distance_in_words" translations #34

Closed everton closed 8 months ago

everton commented 9 months ago

I saw the nice touch you put on adding the "datetime.distance_in_words.short.*" translations to present the time in a more concise format, but this leads to a problem if the application uses locales different than :en: instead of the time, the translation missing message will be presented.

To circumvent this, the application will need to have :en as a default fallback (which may not be the preferred behavior for some apps) or the devs will be required to replicate your formats on their own translation files.

I think the best solution would be to just use the default and generally accepted "datetime.distance_in_words".

Another alternative is to force the :en locale using an around_action in the ErrorsController (I think this is acceptable, since my point is not that the errors' reports should not be in English). I'm using this approach in a fork and I can provide this as a pull request if you feel it is preferrable.