Ok, here's how I did it. Not the optimal solution, but works for me. I created a utility program in Java to find all the method calls and compare the parameters to existing translations.
- Find all classes in my project's root package using the Reflections library
- Find all
getTranslation
method calls of the correct class in the classes using the Javassist library and create a list of them (contains: package, class, row number) - Read the appropriate .java files in the project directory from the given row until the ';' character
- Extract the parameter value and add it to a list
- Find the missing translations and output them
- Find the redundant translations and output them
It took me a while to do this, but at least I now have a reusable utility to keep the translation files up to date.