Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localize dates in error messages #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

florent
Copy link

@florent florent commented Feb 3, 2017

Hi,
Simple change to take advantage of I18n when displaying dates in error messages. I need months in French :)

@adzap
Copy link
Owner

adzap commented Feb 4, 2017

Thanks for this.

One issue is that most of the translations do not belong in this gem. Month names etc. are handled by Rails. Please look a the English i18n yml file, those are the only keys controlled by this gem.

If you can reduce the yml file to just those keys this will make a great addition.

@florent
Copy link
Author

florent commented Feb 6, 2017

The keys in the existing English i18n yml file don't provide any translation for days/months names. Therefore it's impossible to localize dates using any other thing than numbers.

I understand that you want to be framework/lib agnostic but I still believe that the gem must provide a way to localize dates properly.

Most users will use it with Rails, so why not provide support for rails i18n translations and fallback to #strftime if the i18n keys are missing? Rails I18n keys for this are kind of a de-facto standard after all.

If you still don't want to do this, you could always add your own I18n keys for days/month names. You'd remain independent from other libs and allow dates localizations.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants