Question

Can anyone point me to the code that CopyCopter uses to scan views for translations?

I considered using CopyCopter as my i18n back end but it has proved too problematic to upgrade it to Rails 4, perhaps when I have more time I'll have a go; So I have chosen to use the tolk gem (https://github.com/tolk/tolk) which is great but it relies on the main yml file to be maintained. This is not an option as there are non technical people working on adding new text plus there will be too many keys to be able to maintain yml files manually.

So I need a tool that will scan views for translation erb tags, check if there is a corresponding tag in the main yml file and add it if one does not exist.

It is my understanding that copycopter has functionality that scans views in this way and I thought I could rip the code out and adapt it for my needs but I have been unable to find the code in either the client (https://github.com/copycopter/copycopter-ruby-client) or the server (https://github.com/copycopter/copycopter-server).

I really want to avoid providing a web interface to manually add keys. That would be too open to mistakes as there will be likely over 8,000 keys.

Any help appreciated or alternative suggestions.

Was it helpful?

Solution

I have found a solution with the i18n-missing_translations gem https://github.com/svenfuchs/i18n-missing_translations. I need to do a bit of work to make them play nicely together but all should be good.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top