I have a 60k line json that holds key:value for localization of a huge website
example:
{
"message": "讯息"
}
and there's a file for each language.
I created a c# script that scans each ts & html file in my project
if on ts there's a regex that matches for .translate("string"), that string key is kept
and if in html the key is used next to a pipe, that key is also kept
all other unused keys will be deleted
but since I am using regex there are so many edge cases that don't work, specially since there could be a lot of differences when it comes to stylers, whitespaces...etc
Any idea how to do something like this in the context of vscode or whatever context:
scan all the ts files and whenever there's a ts file that injects translationService & uses the translate() method, take the passed key and log it somewhere
or get all references to a method, and see what value is passed to it.
also scan all the html files and whenever there's usage of my translation pipe, check the passed value and log it somewhere