longbridgeapp/rust-i18n

Multiple definitions of same key shows no error

Opened this issue ยท 3 comments

Hey, thanks for this crate! ๐Ÿ™

When moving one of my project to use it, I added the same key twice by accident. Obviously the end result of what was displayed was not as expected ๐Ÿ˜“

I don't know how feasible it is, but it would be awesome if this could be caught at compile time with a clear message :)

In some times we may need to override a key, so this can't add any warning.

Couldn't it be an option? If not big deal

@crowdagger It may help if you use a yaml file as a workaround. In my case I'm using a single yaml file for all translations. This way my IDE warns me if the same key is defined twice. Hope this helps! ๐Ÿ˜Š