rust-i18n icon indicating copy to clipboard operation
rust-i18n copied to clipboard

Multiple definitions of same key shows no error

Open crowdagger opened this issue 2 years ago • 3 comments

Hey, thanks for this crate! :pray:

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 :sweat:

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 :)

crowdagger avatar Aug 19 '23 04:08 crowdagger

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

huacnlee avatar Aug 21 '23 01:08 huacnlee

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

crowdagger avatar Aug 22 '23 03:08 crowdagger

@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! 😊

Mastermindaxe avatar May 31 '24 08:05 Mastermindaxe