Quantifable internationalization with xlf-analyze
08.08.2025A CLI tool born from a simple question: how much of an Angular application is translated?
Introducing xlf-analyze, an npm package used to get insight into XLIFF files. See an example run below:
As I stated in the previous article about best practices, i18n is where business meets development. Localization services cost, and it’s good to make informed decisions. This utility helps with just that, telling you about state of your language versions:
- presence of unexpected or unset
state
values (the(index)
column lists all encountered ones) - whether there are translations mistakenly marked as
new
ortranslated
- number of words that need translation (handy for estimating work)
CLI FTW
Writing a command line application is honestly a great break from typical workload. You are not constrained by a framework or test coverage. You can get to ship self-contained, useful piece of software in hours. It’s also quite an exercise in API design - in this context, all you have is flags and arguments, so they are better well laid out and documented. Heck, you can even try a completely different programming language.
Interesting fact: despite xlf-analyze handles XML, I chose not to rely on dedicated library, just to introduce bugs minimize dependencies. The readline
proved to be working, and subjectively fast.