tonsky / tongue

Do-it-yourself i18n library for Clojure/Script
Eclipse Public License 1.0
307 stars 19 forks source link

No support for deeply nested dictionaries? #17

Closed joncol closed 5 years ago

joncol commented 5 years ago

Hi, thanks for the nice library.

There seems to be some problem with dictionaries with deeper nesting levels.

I tried with the following dictionary:

{:en {:animals {:dog "Dog"                      ;; => :animals/dog
                :cat "Cat"                      ;; => :animals/cat
                :flying {:bird "Bird"           ;; => "Missing key"
                         :dinosaur "Dinosaur"}} ;; => "Missing key"

The flying keys are not found when trying to reference them as :animals.flying/bird, or :animals/flying.bird for instance.

:cat and :dog (which are only 1 nesting-level deep) work fine of course.

Is this something you would consider adding support for?

tonsky commented 5 years ago

There will be under :animals.flying/bird etc. Last segment catenated using /, rest using .

joncol commented 5 years ago

I tried this, but it gave the same error message. I have a minimal failing example at https://bitbucket.org/joncol/tongue-play if you'd like to have a look.

tonsky commented 5 years ago

You are correct, those are simply not supported. I’d love to add support for them though

valerauko commented 5 years ago

@tonsky I put up a PR with the behavior described above working. Hope it's all right