i18n language files. How to manage missing and unused keys

2.1k Views Asked by At

I have a Rails/Angular webapp. We use two different methods to translate our app: Ruby Globalize i18n with the corresponding yml language files, and angular-translate with the corresponding json language files. Managing language files can be a pain. I just found the i18n-tasks gem on github to help find missing and unused keys in my yml language files. It works great! Does anyone know of a similar static analysis tool to help manage json language files? Is there a better way to do this?

As I write this I am wondering if there is some sort of i18n transpilation that I could do. Keep a single language file and generate the yml and json from that.

Features wanted:

  • sort keys alphabetically
  • delete unused keys in all language files
  • add missing keys in all language files
1

There are 1 best solutions below

0
glebm On

i18n-tasks already supports JSON, but you would need to write a custom scanner to detect usages of angular-translate. See the custom scanner example.