Closed ystael closed 10 years ago
Hi Chris, thanks for the detailed report - that was helpful.
As you suspected, this is a bug. Have just pushed v2.0.1
which should correct the problem. In case you're curious, the issue was that the get-tr
fn uses the dynamic scope - not something we want for the :missing
key fallback. The unit tests were failing to catch this because it only surfaces when combined with a with-tscope
as in your case.
This is great -- thank you very much for the quick fix!
On Mon, Nov 25, 2013 at 12:43 PM, Peter Taoussanis <notifications@github.com
wrote:
Hi Chris, thanks for the detailed report - that was helpful.
As you suspected, this is a bug. Have just pushed v2.0.1 which should correct the problem. In case you're curious, the issue was that the get-trfn uses the dynamic scope - not something we want for the :missing key fallback. The unit tests were missing this because it only surfaces when combined with a with-tscope as in your case.
— Reply to this email directly or view it on GitHubhttps://github.com/ptaoussanis/tower/issues/36#issuecomment-29223287 .
Np, cheers :-)
I just upgraded my project to tower 2.0.0 from 1.2.0, and it seems that parent scopes are no longer searched for missing translations. If I have the dictionary:
and I call
then I get a NullPointerException because the key
:error/missing
is not found. I have to add another:missing
translation in the:error
subdictionary for this to work.Is this behavior intentional? The comment at https://github.com/ptaoussanis/tower/blob/master/src/taoensso/tower.clj#L438 seems to indicate that parent scopes should be searched for missing translation messages.
Here are traces of the behavior with and without the extra missing translation key: