desentio / weploy-translate

weploy.ai - Translate websites with ai
https://weploy.ai
7 stars 1 forks source link

WEPLOY fix #3

Closed 2567910 closed 5 months ago

2567910 commented 1 year ago

We need to make sure that users cannot translate something from german to german. This is currently happening if you trigger a useffect but the text is already translated. (This could happen in production?)

There is a simple fix fot that.

If the backend gets translation request like {toLanguaguage="DE", defaultLanguage="EN" } just check the find string with more then one word in the strings array and check if the original value is already a translation result in the database.

Example:

Input: {toLanguaguage="DE", defaultLanguage="EN", string: "Das ist Deutsch" } Backend: check in db if translation from en to DE with translation result "Das ist Deutsch" already exists. If so this is an invalid request because the input string is not english.

Output: {400 Error The input language does not match the expacted default lang input.}

{"weploy" (EN) -> translations "weploy" DE }

2567910 commented 1 year ago

Image

jemikanegara commented 1 year ago
jemikanegara commented 1 year ago

Image