next-translate icon indicating copy to clipboard operation
next-translate copied to clipboard

[Feature Request] A tool for finding missing keys

Open l-you opened this issue 2 years ago • 4 comments

Maybe somebody would like to implement this in future?

Discussed in https://github.com/aralroca/next-translate/discussions/1003

Originally posted by rusted-love March 11, 2023 Is there a tool that validates a key for each language presented ? For example, runtime warning logs may not be produced because translation is used in modal dialog. Missing translation cannot be done without some kind of unit testing. Command-line tool would prevent such kind of bugs.

I have seen how missing keys extractor implemented in lingui , it would be amazing to have something similar in next-translate.

l-you avatar Jun 07 '23 07:06 l-you

You can use logger in the configuration to log the missing keys or integrate it there with some tool

aralroca avatar Jun 07 '23 08:06 aralroca

You can use logger in the configuration to log the missing keys or integrate it there with some tool

It does not see missing keys in modal dialogs because they are not active. + there is no tool that finds missing keys across locales folder. Solution can be less complex that "integrated unit tests that finds a missing keys by simulating application runtime".

l-you avatar Jun 07 '23 08:06 l-you

Ok @rusted-love make sense, we can keep this issue open. Feel free to contribute to this 👍

aralroca avatar Jun 07 '23 08:06 aralroca

Can we do something like this?

type Messages = typeof import('./messages/en.json');
declare interface IntlMessages extends Messages {}

darr1s avatar Aug 09 '23 03:08 darr1s