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
When I create a new translation unit using the REST API, the unit is created with the correct value, but the key is a (seemingly) random hexadecimal value. For example, attempting to create a unit with key "TestKey" results in a unit with key "0x81f0a4746646681" instead (the value is correct).
I already tried
Tried both JSON and x-www-form-urlencoded payloads, tried different types of keys (only letters, alphanumeric, only numbers, etc.).
Tried calling the API with both Postman and cURL (on the CLI).
Creating keys through the Web UI works as expected, it's just the REST API that shows this behaviour.
To Reproduce the issue
Steps to reproduce the behavior:
Use Weblate from Docker, locally (i.e. localhost:8080)
Create a new project (test-001) and component (db), set up VCS with a git repo;
Add a base file, monolingual - I used i18next JSON format to the repo, push and let Weblate sync;
Perform the following API call:
curl --location --request POST 'http://127.0.0.1:8080/api/translations/test-001/db/en/units/' \
--header 'Authorization: Token <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "TestKey",
"value": ["This is the content for TestKey"]
}'
Expected behavior
A new translation unit with key "TestKey" is created.
SystemCheckError: System check identified some issues:
CRITICALS:
?: (weblate.E003) Cannot send e-mail ([Errno -2] Name or service not known), please check EMAIL_* settings.
HINT: https://docs.weblate.org/en/weblate-4.4.2/admin/install.html#out-mail
WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.
INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
HINT: https://docs.weblate.org/en/weblate-4.4.2/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
HINT: https://docs.weblate.org/en/weblate-4.4.2/admin/backup.html
System check identified 7 issues (1 silenced).
The text was updated successfully, but these errors were encountered:
diff --git i18next/en.json i18next/en.json
index fb3a7be..fa99181 100644
--- i18next/en.json+++ i18next/en.json@@ -3,5 +3,6 @@
"apple": "I have an apple",
"apple_plural": "I have {{count}} apples",
"apple_negative": "I have no apples",
- "key": "value"+ "key": "value",+ "key2": "value2"
}
What looks correct to me.
I'm testing on 4.5-dev though and there were quite some changes in the related code, so I assume that it was fixed. Most likely as a side effect of other changes, most likely f2dc694.
Describe the issue
When I create a new translation unit using the REST API, the unit is created with the correct
value
, but thekey
is a (seemingly) random hexadecimal value. For example, attempting to create a unit withkey
"TestKey" results in a unit withkey
"0x81f0a4746646681" instead (the value is correct).I already tried
Tried both JSON and x-www-form-urlencoded payloads, tried different types of keys (only letters, alphanumeric, only numbers, etc.).
Tried calling the API with both Postman and cURL (on the CLI).
Creating keys through the Web UI works as expected, it's just the REST API that shows this behaviour.
To Reproduce the issue
Steps to reproduce the behavior:
localhost:8080
)test-001
) and component (db
), set up VCS with agit
repo;i18next
JSON format to the repo, push and let Weblate sync;Expected behavior
A new translation unit with
key
"TestKey" is created.Server configuration and status
Docker running locally.
Weblate deploy checks
The text was updated successfully, but these errors were encountered: