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

Microsoft automatic translation fails for Serbian ("sr") #9565

Closed
2 tasks done
derkoe opened this issue Jul 14, 2023 · 1 comment · Fixed by #9567
Closed
2 tasks done

Microsoft automatic translation fails for Serbian ("sr") #9565

derkoe opened this issue Jul 14, 2023 · 1 comment · Fixed by #9567
Assignees
Labels
bug Something is broken.
Milestone

Comments

@derkoe
Copy link
Contributor

derkoe commented Jul 14, 2023

Describe the issue

For the locale Serbian - "sr" the automatic translation with Microsoft Translator does not work. There are no "Automatic suggestions" and the "Automatic translation" tool does not get any texts.

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 Microsoft Translator to Weblate
  2. Create a project and component with the language "Serbian" - "sr"
  3. Go to /translate/{project}/{component}/sr/?q=state:<translated and see that no texts are suggested

Expected behavior

Automatic suggestions should be shown for Serbian.

Screenshots

No response

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

  • Weblate: 4.18.2
  • Django: 4.2.2
  • siphashc: 2.1
  • translate-toolkit: 3.9.2
  • lxml: 4.9.2
  • Pillow: 9.5.0
  • nh3: 0.2.13
  • python-dateutil: 2.8.2
  • social-auth-core: 4.4.2
  • social-auth-app-django: 5.2.0
  • django-crispy-forms: 2.0
  • oauthlib: 3.2.2
  • django-compressor: 4.4
  • djangorestframework: 3.14.0
  • django-filter: 23.2
  • django-appconf: 1.0.5
  • user-agents: 2.2.0
  • filelock: 3.12.2
  • rapidfuzz: 3.1.1
  • openpyxl: 3.1.2
  • celery: 5.3.1
  • django-celery-beat: 2.5.0
  • kombu: 5.3.1
  • translation-finder: 2.15
  • weblate-language-data: 2023.5
  • html2text: 2020.1.16
  • pycairo: 1.24.0
  • PyGObject: 3.44.1
  • diff-match-patch: 20230430
  • requests: 2.31.0
  • django-redis: 5.3.0
  • hiredis: 2.2.3
  • sentry-sdk: 1.26.0
  • Cython: 0.29.35
  • misaka: 2.1.1
  • GitPython: 3.1.31
  • borgbackup: 1.2.4
  • pyparsing: 3.0.9
  • pyahocorasick: 2.0.0
  • python-redis-lock: 4.0.0
  • charset-normalizer: 3.1.0
  • Python: 3.11.4
  • Git: 2.30.2
  • psycopg2: 2.9.6
  • phply: 1.2.6
  • ruamel.yaml: 0.17.32
  • tesserocr: 2.6.0
  • boto3: 1.26.164
  • zeep: 4.2.1
  • aeidon: 1.12
  • iniparse: 0.5
  • mysqlclient: 2.2.0
  • Mercurial: 6.4.5
  • git-svn: 2.30.2
  • git-review: 2.3.1
  • Redis server: 6.2.12
  • PostgreSQL server: 13.10
  • Database backends: django.db.backends.postgresql
  • Cache backends: default:RedisCache, avatar:FileBasedCache
  • Email setup: django.core.mail.backends.smtp.EmailBackend: mailz.porsche.co.at
  • OS encoding: filesystem=utf-8, default=utf-8
  • Celery: redis://localhost:6379/1, redis://localhost:6379/1, regular
  • Platform: Linux 3.10.0-1160.90.1.el7.x86_64 (x86_64)

Weblate deploy checks

System check identified some issues:

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
        HINT: https://docs.weblate.org/en/latest/admin/install.html#collecting-errors

System check identified 1 issue (1 silenced).

Additional context

It seems that Microsoft translator treats "sr" as "sr-Latn".

For example:

POST https://api-eur.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=sr
Content-Type: application/json

[{"Text":"Hello World!"}]

gets the answer

[
  {
    "translations": [
      {
        "text": "Zdravo svete!",
        "to": "sr-Latn"
      }
    ]
  }
]

I think this has to be added to the language_map:

language_map = {

derkoe added a commit to derkoe/weblate that referenced this issue Jul 14, 2023
Add the mapping "sr" -> "sr-Latn" to the language map.

Fixes WeblateOrg#9565
@nijel nijel added this to the 5.0 milestone Jul 14, 2023
@nijel nijel added the bug Something is broken. label Jul 14, 2023
nijel pushed a commit that referenced this issue Jul 14, 2023
Add the mapping "sr" -> "sr-Latn" to the language map.

Fixes #9565
@github-actions
Copy link

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.

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

Successfully merging a pull request may close this issue.

2 participants