4 ms·
I wrote a JS plugin over a decade ago that would scan your page for strings, use google's free translate API to translate it to the target language, and save th
by knodi123 4y ago
I wrote a JS plugin over a decade ago that would scan your page for strings, use google's free translate API to translate it to the target language, and save the translations to a local xx.yml file in the locales directory. It was designed for rails, since I needed to pick something for the backend local file caching, but I could rewrite it for other backends in an hour.
I would browse our sites in french, spanish, and english, and then we just had a fluent expert flip through the generated yml files and make any tweaks they felt were necessary. The translation wasn't perfect, but it was pretty good, and they were table to do a whole site translation in less than an hour and feel confident they got everything.
It died from config rot, but it worked great until google changed some APIs. Ah, I just looked it up - 13 years ago!!
- loa_observer 4y agowow, that sounds great. I love the idea that it can generate locale files direct from a webpage. It's a pity that it is not available now.
- leros 4y agoI did something similar. New strings would get Google Translate translations when we merged changes in. Then it would kick off a translation job through a human translation service. We'd have to periodically poll that service to pull translations in. Then once we pushed to QA, our in-house teams could look at the app and tweak the translations. It worked most of the time, but the lack of context around what the strings were for did result in bad translations.