smartnsoft / FlappyTranslator

A tool which automatically generates Flutter localization resources from CSV and Excel files.
MIT License
58 stars 19 forks source link

[Idea] Add automatic translations using an API such as Deepl or Google Translate #53

Open lukaskurz opened 2 years ago

lukaskurz commented 2 years ago

I was thinking, that it would be nice to have a feature, that can automatically translate and insert missing translations into our translation file. I have a similar workflow set up, since I often have to translate into languages I dont speak. Do you think this would be something that fits into the scope of this library ? If so, then I could implement it and send you a PR for it. Otherwise I'm just going to put it into a seperate package.

defuncart commented 2 years ago

Hi @lukaskurz, thanks for the suggestion! Automatic translation is a little out of scope of this package, however I do think that flappy_translator could optionally make use of such functionality.

Assuming that an automatic_translator (must be dart only) package exists, flappy could depend on this package. A setting translate_empty_values (defaulting to false) could be added. Then CodeGenerator could optionally use some api like AutomaticTranslator.translate(defaultWord) and save this in maps instead of defaultWord when words[wordIndex] is empty.

Some error handling and tests would need to be added, code would be async instead of sync etc. I don't see any breaking changes arising.