Repository: WeblateOrg/weblate

Issue:
Microsoft automatic translation fails for Serbian ("sr")
### 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

- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] 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

```shell
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`: https://github.com/WeblateOrg/weblate/blob/5674acc39e21ea092c0d2fba89569b802315595a/weblate/machinery/microsoft.py#L26


Discussion:

Resolving patch:
diff --git a/weblate/machinery/microsoft.py b/weblate/machinery/microsoft.py
--- a/weblate/machinery/microsoft.py
+++ b/weblate/machinery/microsoft.py
@@ -32,6 +32,7 @@ class MicrosoftCognitiveTranslation(MachineTranslation):
         "tlh-qaak": "tlh-Piqd",
         "nb": "no",
         "bs-latn": "bs-Latn",
+        "sr": "sr-Latn",
         "sr-latn": "sr-Latn",
         "sr-cyrl": "sr-Cyrl",
         "mn": "mn-Mong",


Test patch: