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

[#346] Fix Akkoma translations. #606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blacklight
Copy link

Not sure if something has changed in the Akkoma API since the latest version of AkkomaTranslateStatus, but it seems that the API expects the target language to be lowercase (not uppercase).

Libretranslate nginx traces from my instance with the current implementation show a 400 with the current implementation:

1.2.3.4 - - [11/Feb/2025:11:40:34 +0100] "POST /translate HTTP/1.1" 400 32 "-" "Akkoma 3.13.2-0-g050bc74; https://myinstance.social <[email protected]>"

And that's also mirrored on my Akkoma logs:

1.2.3.4 - - [11/Feb/2025:11:40:35 +0100] "GET /api/v1/statuses/Ar0PZaoyJwN2GD3UJs/translations/EN HTTP/2.0" 400 54 "-" "MoshidonAndroid/2.3.0+fork.108.moshinda"

A direct API call to the endpoint above indeed returns a 400:

{"error":"libre_translate: request failed (code 400)"}

But everything works when en is used instead of EN:

{"text":"<p>Help me! </p><p>**As a large organization you go to Mastodon because: **<br/>- You want to set a standard<br/>- Guarantee your free access to your posts<br/>- as an anti-reaction against big tech and its associated:<br/> - data collections<br/> - earning models<br/> - algorithms that spread her<br/>- ... </p><p>**You run your own server because: **<br/>- your owner wants to remain over your dates<br/>- you can arrange your own accounts for your employees<br/>- ...</p><p>What arguments would you have for switching to Mastodon and own server?</p>","detected_language":"nl"}

Closes: #346

Not sure if something has changed in the Akkoma API since the latest
version of `AkkomaTranslateStatus`, but it seems that the API expects
the target language to be _lowercase_ (not _uppercase_).

Libretranslate nginx traces from my instance with the current
implementation show a 400 with the current implementation:

```
1.2.3.4 - - [11/Feb/2025:11:40:34 +0100] "POST /translate HTTP/1.1" 400 32 "-" "Akkoma 3.13.2-0-g050bc74; https://myinstance.social <[email protected]>"
```

And that's also mirrored on my Akkoma logs:

```
1.2.3.4 - - [11/Feb/2025:11:40:35 +0100] "GET /api/v1/statuses/Ar0PZaoyJwN2GD3UJs/translations/EN HTTP/2.0" 400 54 "-" "MoshidonAndroid/2.3.0+fork.108.moshinda"
```

A direct API call to the endpoint above indeed returns a 400:

```
{"error":"libre_translate: request failed (code 400)"}
```

But everything works when `en` is used instead of `EN`:

```
{"text":"<p>Help me! </p><p>**As a large organization you go to Mastodon because: **<br/>- You want to set a standard<br/>- Guarantee your free access to your posts<br/>- as an anti-reaction against big tech and its associated:<br/> - data collections<br/> - earning models<br/> - algorithms that spread her<br/>- ... </p><p>**You run your own server because: **<br/>- your owner wants to remain over your dates<br/>- you can arrange your own accounts for your employees<br/>- ...</p><p>What arguments would you have for switching to Mastodon and own server?</p>","detected_language":"nl"}
```
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

Successfully merging this pull request may close these issues.

Issue with translation feature on Akkoma
1 participant