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

Some languages have no suggestion from ModernMT #9357

Closed
2 tasks done
urbalazs opened this issue Jun 7, 2023 · 4 comments
Closed
2 tasks done

Some languages have no suggestion from ModernMT #9357

urbalazs opened this issue Jun 7, 2023 · 4 comments
Assignees
Labels
enhancement Adding or requesting a new feature.
Milestone

Comments

@urbalazs
Copy link
Contributor

urbalazs commented Jun 7, 2023

Describe the issue

I have a self hosted Weblate and a ModernMT subscription. Some languages get suggestions from ModernMT, others don't.

Works: ar_SA, bg, ca, cs, da, de, et, fi, fr_CA, fr, gl, he, hi, hr, hu, id, it, ja, lt, lv, mk, ms, nb_NO, nl, pl, ro, ru, sk, sl, sv, sw, th, uk, vi

Does not work: el, en_CA, en_GB, es, es_CO, es_MX, fa, ko, pt, pt_BR, sr_Cyrl, tr, zh_Hans, zh_Hant

When I call the API from command line, I get translation.

curl -X POST \
    -H "X-HTTP-Method-Override: GET" \
    -H "Content-Type: application/json" \
    -H "MMT-ApiKey: $MY_API_KEY" \
    --data '{"source": "en", "target":"el", "q":["Deploy ACLs"]}' \
    --no-progress-meter \
    --compressed \
    "https://api.modernmt.com/translate" |\
    jq
{
  "status": 200,
  "data": [
    {
      "translation": "Ανάπτυξη ACL",
      "billedCharacters": 11,
      "characters": 11,
      "billed": true
    }
  ]
}
curl -X POST \
    -H "X-HTTP-Method-Override: GET" \
    -H "Content-Type: application/json" \
    -H "MMT-ApiKey: $MY_API_KEY" \
    --data '{"source": "en", "target":"sr_Cyrl", "q":["Deploy ACLs"]}' \
    --no-progress-meter \
    --compressed \
    "https://api.modernmt.com/translate" |\
    jq
{
  "status": 200,
  "data": [
    {
      "translation": "Распореди АЦЛ-ове",
      "billedCharacters": 11,
      "characters": 11,
      "billed": true
    }
  ]
}

I already tried

  • I've read and searched the documentation.
  • I've searched for similar issues in this repository.

Steps to reproduce the behavior

  1. Add you ModernMT API key to Weblate.
  2. Ask a translation for language de (German). This works fine.
  3. Ask a translation for language el (Greek). The is no translation suggestion.

Expected behavior

All languages should get translation suggestion from ModernMT.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

4.16.4

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Jun 7, 2023

Some are not supported by ModernMT (for example fa). For some Weblate is missing aliases (Chinese variants), I will fix that.

Rest seems to work just fine for me. Do you get any errors in the logs?

@nijel nijel added the enhancement Adding or requesting a new feature. label Jun 7, 2023
@nijel nijel self-assigned this Jun 7, 2023
@nijel nijel added this to the 4.18 milestone Jun 7, 2023
@nijel nijel closed this as completed in 5c58c78 Jun 7, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

@urbalazs
Copy link
Contributor Author

urbalazs commented Jun 26, 2023

I found that Persian language code (fa in Weblate) can be replaced by pes based on the language list of ModernMT.

And we need a Portuguese mapping similar to DeepL.

@nijel can you please update the language_map of ModernMT?

    language_map = {
+       "fa": "pes",
+       "pt": "pt-PT",
        "sr_Cyrl": "sr",
        "zh_Hant": "zh-TW",
        "zh_Hans": "zh-CN",
    }

nijel added a commit that referenced this issue Jun 27, 2023
@nijel
Copy link
Member

nijel commented Jun 27, 2023

Done, thanks for suggestion.

nijel added a commit that referenced this issue Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants