-
-
Notifications
You must be signed in to change notification settings - Fork 958
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
Can not use the translation/file REST API #8417
Comments
The available choices depend on the scope and permissions. Are you uploading to the source or translation? Do you have full permissions or translate only? |
Thanks for your comment. I think the errors I had with the "add" method was because I was sending it to a translation language.
I need to migrate the text properties to weblate while keeping the rest of the catalog as it is.
I have a version of the script that works like this:
I'd like to make sure this script will never override strings that were translated in weblate and I thought the "conflicts" param would let me do that. |
Okay, this is a bug – the documentation states
It probably won't work via the upload because it skips blank strings. I'm uncertain if it will work via https://docs.weblate.org/en/latest/api.html#post--api-translations-(string-project)-(string-component)-(string-language)-units- |
This should give users better clue what might be wrong. See #8417
Thank you for your report; the issue you have reported has just been fixed.
|
Thanks for investigating and fixing the issue so fast ! |
Describe the issue
Hello,
I can not get this API to work: https://docs.weblate.org/en/latest/api.html#post--api-translations-(string-project)-(string-component)-(string-language)-file-
I get this message when I try to use the "conflicts" parameter:
{"conflicts":[""ignore" is not a valid choice."]}
I get this message when I try to use "method":"add":
{"method":"This method is not available here."}
It does work with "method":"replace" but I need the whole API to work.
Here is the node script I use to make the call:
The file I'm sending is a basic JSON such as {"my-key":"my-value"}
Did I miss something ?
I already tried
Steps to reproduce the behavior
400 Bad Request
{"method":"This method is not available here."}
Expected behavior
The request should not fail as I'm using the parameters described in the doc ?
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
Docker container
Weblate versions
I don't have a direct access to the server, but this is what I can see in the web page:
Powered by Weblate 4.14.2
Weblate deploy checks
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: