© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
shadi

Not angular specific - general guidance needed

I have a 60k line json that holds key:value for localization of a huge website
example:
{ 
  "message": "讯息"
}
{ 
  "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
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

LLVMSharp guidance needed
C#CC# / help
4y ago
✅ Guidance needed for encryption
C#CC# / help
2y ago
❔ guidance on protecting sensitive details (licence details) needed
C#CC# / help
3y ago
More general courses or specific courses
C#CC# / help
3mo ago