# KeyValue backend and links issues

**URL:** <https://www.ruby-forum.com/t/keyvalue-backend-and-links-issues/187754>\
**Category:** Rails I18n\
**Created:** [April 28, 2010, 9:25pm UTC](https://www.ruby-forum.com/t/keyvalue-backend-and-links-issues/187754 "2010-04-28T21:25:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![josevalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@josevalim](https://www.ruby-forum.com/u/josevalim)\
**Post date:** [April 28, 2010, 9:25pm UTC](https://www.ruby-forum.com/t/keyvalue-backend-and-links-issues/187754/1 "2010-04-28T21:25:28Z")

</div>

Hey guys,

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:

[http://github.com/svenfuchs/i18n/blob/master/test/api/tests/link.rb#L38](http://github.com/svenfuchs/i18n/blob/master/test/api/tests/link.rb#L38)

The test fails because it’s finding the absolute key instead of the  
relative. I could make it pass but there are two issues:

1. 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)

1. 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?

---

<div class="post-metadata">

**Author:** ![josevalim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@josevalim](https://www.ruby-forum.com/u/josevalim)\
**Post date:** [April 29, 2010, 7:19pm UTC](https://www.ruby-forum.com/t/keyvalue-backend-and-links-issues/187754/2 "2010-04-29T19:19:05Z")

</div>

Hi,

I don’t use links in translations at all. I think your reasons to  
change it are reason enough to change it.  
I18n is a tricky library to understand, so consistency should a be  
very important goal.

Iain
