google-translator icon indicating copy to clipboard operation
google-translator copied to clipboard

Ability to get all translation cases, synonymous, examples and pronunciation of word(s) as a URL to audio

Open svonidze opened this issue 4 years ago • 1 comments

svonidze avatar Nov 25 '20 08:11 svonidze

This looks like a good idea. I needed the pronunciation of the translated results which could not be obtained by the current library. Ended up having to make some small changes to google_translator.dart

final data = await http.get(url.toString() + '&dt=rm');

to get the API to return the pronunciation, then

final sb2 = jsonData[0][1][2].toString();

to access that pronunciation.

Had to modify translation.dart to add a new field to the classes too.

final String source;

so that the pronunciation results can be stored and retrieved.

But this PR looks like a more comprehensive implementation, looking forward to seeing it merged.

vivian-ng avatar Mar 10 '21 07:03 vivian-ng