You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Weblate doesn't map language codes consistently across all URLs and returns a 404 error in some cases. Maybe an API issue. The web UI seems to behave as expected.
I already tried
Describe the steps you tried to solve the problem yourself.
I've read and searched the docs and did not find the answer there.
If you didn’t try already, try to search there what you wrote above.
To Reproduce the issue
Steps to reproduce the behavior:
Access: https://<weblate>/languages/zh_CN/.
This is mapped to https://<weblate>/languages/zh_Hans/ as expected.
POST a translation file to https://<weblate>/api/translations/<project>/<component>/zh_CN/file/.
This results in an error 404 'Not Found' JSON: {"detail":"Not found."} response.
This is the case that I came across. There may be more. Maybe the API bypasses the language code mapping?
The web UI always switches from zh_CN URLs to zh_Hans in the cases that I have tried.
Expected behavior
That in all cases zh_CN is mapped to zh_Hans without an error.
Screenshots
Exception traceback
Server configuration and status
Weblate installation: Docker
Weblate deploy checks
Additional context
The text was updated successfully, but these errors were encountered:
There is no mapping in the API and I don't think there should be one - it would be broken for non-GET (POST/PATCH/DELETE) requests anyway. Such request would be consumed by the redirect and the correct location would be served as GET. #4798 is an example of such behaviour (though it has different cause there).
For the UI part we only redirect GET requests as that is what most people do - click on a link which is no longer valid (after renaming project/component or merging languages).
Sound logical. If this is intended behaviour, I'm fine with it. It's no problem to handle the mapping on the client side. I just had to know that it should be done this way.
Weblate doesn't map language codes consistently across all URLs and returns a 404 error in some cases. Maybe an API issue. The web UI seems to behave as expected.
I already tried
Describe the steps you tried to solve the problem yourself.
If you didn’t try already, try to search there what you wrote above.
To Reproduce the issue
Steps to reproduce the behavior:
https://<weblate>/languages/zh_CN/
.This is mapped to
https://<weblate>/languages/zh_Hans/
as expected.https://<weblate>/api/translations/<project>/<component>/zh_CN/file/
.This results in an error 404 'Not Found' JSON:
{"detail":"Not found."}
response.This is the case that I came across. There may be more. Maybe the API bypasses the language code mapping?
The web UI always switches from zh_CN URLs to zh_Hans in the cases that I have tried.
Expected behavior
That in all cases zh_CN is mapped to zh_Hans without an error.
Screenshots
Exception traceback
Server configuration and status
Weblate installation: Docker
Weblate deploy checks
Additional context
The text was updated successfully, but these errors were encountered: