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

DeepLException during MT for languages with faulty bcp tag #2116

Closed
Tracked by #1928
JoeyStk opened this issue Mar 14, 2023 · 1 comment · Fixed by #2124
Closed
Tracked by #1928

DeepLException during MT for languages with faulty bcp tag #2116

JoeyStk opened this issue Mar 14, 2023 · 1 comment · Fixed by #2124
Assignees
Labels
🐛 bug Something isn't working ⁉️ prio: low Not urgent, can be resolved in the distant future. ☺️ effort: low Should be doable in <4h
Milestone

Comments

@JoeyStk
Copy link
Contributor

JoeyStk commented Mar 14, 2023

Describe the Bug

If you try to use the MT for languages with a faulty bcp tag Django errors occur. This issue is quite relevant, because in our live system quite a few bcp codes are filled out "incorrectly", and therefore we would run into a lot of issues when releasing our implementation in April.

Steps to Reproduce

  1. Go to ''languages" and create a language that a. instead of the bcp tag uses a slug and b. create another language that has an incorrect bcp tag
  2. Then click on 'event' or 'locations', ǵo to either one of the newly created languages
  3. Select pages and use the bulk action for machine translation
  4. In both cases, see the error
    grafik

Expected Behavior

Even in cases where instead of the bcp code the slug is filled in the translation should work. And for cases in which the bcp code is filled in incorrectly (e.g. pt_PT instead of pt-PT) there should be an informative error message.

Actual Behavior

In both cases that I described above a django error message appears (see screenshot)

Additional Information

The underlying problem is probably that we check the language slugs when testing for DeepL availability, but when we're actually translating we're sending the bcp tag. This error also appears while using the translation box in our page form, introduced by #2062

@JoeyStk JoeyStk added 🐛 bug Something isn't working ‼️ prio: high Needs to be resolved ASAP. ☺️ effort: low Should be doable in <4h labels Mar 14, 2023
@timobrembeck
Copy link
Member

I could only reproduce this bug for English and Portuguese:

# For some languages, the DeepL client expects the BCP tag instead of the short language code
if target_language.slug in ("en", "pt"):
target_language_key = target_language.bcp47_tag
else:
target_language_key = target_language.slug

For all other languages, the bcp tag is not used during DeepL translation, right?

@timobrembeck timobrembeck added this to the 23Q2 milestone Mar 14, 2023
@timobrembeck timobrembeck added ⁉️ prio: low Not urgent, can be resolved in the distant future. and removed ‼️ prio: high Needs to be resolved ASAP. labels Mar 14, 2023
@timobrembeck timobrembeck changed the title Django error occurs during MT for languages with faulty bcp tag DeepLException during MT for languages with faulty bcp tag Mar 14, 2023
@JoeyStk JoeyStk self-assigned this Mar 14, 2023
@timobrembeck timobrembeck modified the milestones: 23Q2, 23Q1 Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ⁉️ prio: low Not urgent, can be resolved in the distant future. ☺️ effort: low Should be doable in <4h
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants