I wanted to use your library, but it's severly broken for tower/t(ranslate). As you describe in the README, (translate :en-US :example/foo) searches in :en-US, in :en and then in the fallback-locale (by default :en). But in reality that is not the case. It is really only searched in :en-US and in the fallback locale. When testing with another locale (:de-DE) that error hit me:
gives "today" instead of "heute". Giving a :log-missing-translation-fn prints that :example/today was not found (missing).
Examining the code I was confirmed. tower.clj:426 (in 2.0.1) searches only for exact locale matches, because 'loc' is not handled. The comment (Try loc & parents) is unclear or misleading, because this line only tries the different given keys from k-or-ks, but not the 'parent' locale (:de for :de-DE, or :de-DE and :de for :de-DE-somevariant). The code afterwards (the second form of the 'or') handles only the missing case (fallback value or fallback locale), but again wrong (line 436) with the same type of error but the same comment (above).
I wanted to use your library, but it's severly broken for tower/t(ranslate). As you describe in the README, (translate :en-US :example/foo) searches in :en-US, in :en and then in the fallback-locale (by default :en). But in reality that is not the case. It is really only searched in :en-US and in the fallback locale. When testing with another locale (:de-DE) that error hit me:
gives "today" instead of "heute". Giving a :log-missing-translation-fn prints that :example/today was not found (missing).
Examining the code I was confirmed. tower.clj:426 (in 2.0.1) searches only for exact locale matches, because 'loc' is not handled. The comment (Try loc & parents) is unclear or misleading, because this line only tries the different given keys from k-or-ks, but not the 'parent' locale (:de for :de-DE, or :de-DE and :de for :de-DE-somevariant). The code afterwards (the second form of the 'or') handles only the missing case (fallback value or fallback locale), but again wrong (line 436) with the same type of error but the same comment (above).