kataras / i18n

:new: High-performant and powerful localization and internationalization support for Go
https://en.wikipedia.org/wiki/Website_localization
MIT License
113 stars 13 forks source link

[BUG] Inconsistent language matching when loaded as a map #28

Open kamikazechaser opened 1 year ago

kamikazechaser commented 1 year ago

Describe the bug

(*I18n) Tr() is not consistent when producing translated templates. It seems the index of selecting/searching the language is not correct. I use custom language tags e.g. ka-KE (Kamba language).

To Reproduce

Steps to reproduce the behavior:

https://goplay.tools/snippet/55lBTIz199v

Running it multiple times shows that it randomly displays either fr-FR or ka-KE.

Expected behavior

Should only display ka-KE consistently.

Screenshots N/A

Desktop (please complete the following information):

MrAwanishKumar commented 1 year ago

Yes, this is true, I am also facing the same problem.