Conversation
|
At this point, there is a backward compatibility issue. Since
Option 1 is very tedious. Option 3 would likely work, but it introduces unnecessary processing if the initial configuration is already set up, so I’d prefer to avoid it if possible. |
2995e3d to
6d0935d
Compare
|
I think we can start looking into merging this. I have a couple of questions. First: should the format keys live under Although I see that this will cause Second: of the options you give, my preferred is option 3, as it offers easy back-compatibility. When you say it involves unnecessary processing, do you mean in terms of computing performance? If that's so, I think it's not a concern here, as it would be negligible. But perhaps both problems can be solved by sourcing the format strings from somewhere. Is there's a project out there (with a compatible license) where we can respectfully "steal" them from? |
Yes.
This is because the format is used by |
Yes
OK
It looks like we could fall back to defaults provided by For https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/de.yml#L227 Would it be okay if I proceed with the remaining work as follows?
|
6d0935d to
c43637a
Compare
| end | ||
|
|
||
| context "with `prefix` option" do | ||
| context "with `format` option" do |
There was a problem hiding this comment.
This test is not meant to cover the prefix option, so I changed it to use format instead.
| end | ||
|
|
||
| def fallback_format | ||
| I18n.t("date.formats.default", default: "%Y-%m-%d") |
There was a problem hiding this comment.
In environments where rails-i18n is installed, formats.default should always be present, but I've added an additional fallback just in case.
|
@pablobm For the fallback format, I set a simple format that doesn't rely on things like |
…ate_time_default formats
c43637a to
3af6d05
Compare
administrate_date_defaultadministrate_datetime_defaultadministrate_time_default"%I:%M%p", but in Japanese, we would prefer the order"%p %I:%M". I believe other languages may also have their own preferred orders. I have made it possible to change this for each language usingadministrate_time_default.