Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolation positions are broken when translating from/to certain languages (e.g. de>it) #123

Open
codeflorist opened this issue Aug 31, 2024 · 0 comments

Comments

@codeflorist
Copy link

I'm performing translations via DeepL Free API. Here is the command:

npx json-autotranslate --source-language de --directory-structure ngx-translate  --type key-based  --decode-escapes --service deepl-free --config API_KEY

I have a de.json like this:

{
  "confirmation": "Ich habe {privacyPolicy} und {terms} gelesen und akzeptiert."
}

Translating this to en correctly translates the string to:

"I have read and accepted {privacyPolicy} and {terms}."

But translating to it (and most other languages) results in the interpolations being placed at the start of the term instead of their original positions:

"{privacyPolicy} {terms} Ho letto e accettato e ."

The problem does not occur, if the source language is en. So first translating from de to en, and then using the english file to translate to the other languages seems to be a viable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant