participedia / api

Website and API for Participedia V3
https://participedia.net
MIT License
19 stars 13 forks source link

Look into translation cost #1118

Closed paninee closed 2 years ago

paninee commented 2 years ago

The translation costs seem to have gone up triple from when the Dutch language was added, since February. It's normally around $20, it came up to ~$60. And this month it went over to ~$130. We have to assess to see if there's anything wrong with the translation. Do we do any duplicate translation somewhere?

paninee commented 2 years ago

Bug Report

Main Issue: Each language has been translated multiple times in /scripts/generate-entry-i18n.js

Reproducing the issue: Try to publish a Draft without populating other languages. In the background, calls to Google API is running multiple times. These multiple calls might in the server log. Sample below:

ThingID: 123 => saving record for fr from en ThingID: 123 => record for fr from en DONE!

ThingID: 123 => saving record for fr from en ThingID: 123 => record for fr from en DONE!

ThingID: 123 => saving record for fr from en ThingID: 123 => record for fr from en DONE!

Cause: