Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn/Error on duplicate message Id. #332

Open
zumoshi opened this issue Sep 9, 2024 · 0 comments
Open

Warn/Error on duplicate message Id. #332

zumoshi opened this issue Sep 9, 2024 · 0 comments

Comments

@zumoshi
Copy link

zumoshi commented Sep 9, 2024

Assuming the following code:

text, err := localizer.LocalizeMessage(&i18n.Message{
	ID:          "X",
	Other:       "Text 1",
})
// ...
// somewhere else
// ...
text, err := localizer.LocalizeMessage(&i18n.Message{
	ID:          "X",
	Other:       "Something else",
})

is result of a copy paste mishap (forgot to change the message Id), the goi18n extract happily eats/ignores the first message and only outputs the second one to the translation file.

Can we get an error or warning printed out, or at the very list have the extractor create comments for filename/line numbers above the translations in the toml file so we can notice that a certain id is mentioned multiple times and investigate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant