I’ve been working on a KeyValue backend for I18n. The implementation
is quite straightforward and works with different data stores (as
TokyoCabinet and Redis).
Most of the base work was already ported to the I18n master branch but
before merging the KeyValue backend, I need to make all tests pass.
Currently, there is just one test failing:
The test fails because it’s finding the absolute key instead of the
relative. I could make it pass but there are two issues:
- The current test does not make sense at all to me. If the test
pass, it means that the following expression evaluates to false:
I18n.t(“foo.link”) == I18n.t(“link”, :scope => :foo)
- The behavior described in the test (to give preference to relative
key) makes impossible to link to the absolute key if I have a key with
the same name in the relative scope
In my opinion, we should observe exactly the opposite behavior: it
should always reference to the absolute key.
So, what do you guys think? Does anyone actually have a use case for
the current behavior?