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

Hook to commonly catch errors #290

Open
gokatz opened this issue Dec 9, 2022 · 4 comments
Open

Hook to commonly catch errors #290

gokatz opened this issue Dec 9, 2022 · 4 comments

Comments

@gokatz
Copy link

gokatz commented Dec 9, 2022

hey. First of all, Thanks for maintaining this library which helped me localize go serviceseaily.

I'm using this lib in couple of instances. I want to track all the missing translation (MessageNotFound) error for future reporting and fixes. I searched through the docs and cannot find a onError kinda hook something similar to react-intl's onError hook. Is there any recommendations on this? I would be happy to build one :) Thanks

@nicksnyder
Copy link
Owner

nicksnyder commented Dec 9, 2022

"Which messages are missing translations" is a question that seems best answered offline. In fact, the goi18n command has a workflow that generates a file for you with all missing translations so you can go get them translated.

Does that solve your problem?

@gokatz
Copy link
Author

gokatz commented Dec 10, 2022

Hey, @nicksnyder thanks for the response. Requested access :)

Which messages are missing translations

For my use case, messages / IDs for which translation are not available in the translated json file. We try to have 0 English messages in app when the user choose a Non English version. We'll use this hook (or something similar) to audit and fix the issues.

@nicksnyder
Copy link
Owner

nicksnyder commented Dec 10, 2022

messages / IDs for which translation are not available in the translated json file.

correct, but goi18n can produce a file that contains all missing translations (this doesn’t need to happen at runtime)

@gokatz
Copy link
Author

gokatz commented Dec 19, 2022

correct, but goi18n can produce a file that contains all missing translations (this doesn’t need to happen at runtime)

Thanks. I didn't know that. Any documentation on would be great :)

That said, we need runtime analysis, because, runtime provides more weighted analysis. For instance,

  • particular message might not be translated at all. At the same time, that message has nearly zero traffic. In that case, that missing translation issue has less priority vs a missing translation that has huge traffic.
  • there might be missing translations for a message behind a flag. That code path will never be executed until we flip the flag. Until then, this missing translation has not priority at all.

We are building system based on these priorities. Any suggestions would be great :)


Also, can I have the viewer access to that google doc? (gokulkathirvel13@gmail.com)
Can we open that to the web alternatively?

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

2 participants