-
-
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
'str' object does not support item assignment #7294
Comments
If the email with the traceback and the state of variables at time of the exception can be useful, here is a PDF of the email... |
It should work. I've added some tests in translate/translate#4578. What is existing content of the English JSON file (only the portion of story_9795.tsr_0 is interesting here)? |
The issue you've reported needs to be addressed in the translate-toolkit. Please file the issue there, and include links to any relevant specifications about the formats (if applicable). |
The source in this case is Italian, and here is "story_9795": {
"tsr_0": [
[
"‥",
"Combinato Carcer Tullianum & parco"
],
"Archeologico del Colosseo"
] |
In my application code, I am using some placeholders for special characters (I am creating an extendscript plugin for Indesign to extract strings from an Indesign file, translate them, and import them back into Indesign). In the application code, when importing the translations back into Indesign, I am first checking if there is a nested array, and I deal with that first, replacing any special characters back to the originals. Once I have flattened to a simple array, I then join the array with a paragraph separator character (each element of the array is a separate paragraph, even though it belongs to the same "story"). |
I tried manually applying the patch in commit 3ae20f394b4d86d79167ce7694b56dc288b079c2 , however after restarting my uwsgi service I am still getting the same error. |
That commit was not expected to address your issue, it covers a different issue. The issue might be in mixing list and string in the list, the code might assume that all types will be same. I will verify this assumption tomorrow... |
The current content of English file is probably what causes the problems, please share that one. |
It seems the English file needs to be updated based on the Italian source file. There is no "story_9795" key in the English file. Here is a link to the file: https://github.com/opera-romana-pellegrinaggi/catalogo-v-r-test/blob/main/en/translation.json . I have activated the Cleanup translation files plugin, but it doesn't seem to be succeeding in this case. |
When the units are not added in the order of serializing, the lists can have blank space which needs to be filled in with None. This fixes list ordering for newly added strings. Fixes WeblateOrg/weblate#7294
When the units are not added in the order of serializing, the lists can have blank space which needs to be filled in with None. This fixes list ordering for newly added strings. Fixes WeblateOrg/weblate#7294
Cleanup won't help with this (it removes stale strings, it does not help in adding new ones). translate/translate#4579 should fix this. |
When the units are not added in the order of serializing, the lists can have blank space which needs to be filled in with None. This fixes list ordering for newly added strings. Fixes WeblateOrg/weblate#7294
Thank you for your report; the issue you have reported has just been fixed.
|
Fix is working! I was able to successfully commit |
Hello! Getting error at Email trying to commit many changes:
|
@iksent Did you update translate-toolkit as well? In case you did, please include a full exception traceback and open a separate issue. |
We use weblate docker image, should we update it anyway? And how to do this? |
The problem, is that we manually set incorrect JSON as a default template with empty strings.
|
Please open separate issue for that. |
OK, I'll try to do that later. We are trying to resolve this issue now, can you please help?
What should we do to apply changes? |
We found a solution: create new component and migrate translations there. |
Describe the issue
When trying to commit changes for a component with a nested JSON format, I am getting an exception and the commits are not pushed to github.
I already tried
Steps to reproduce the behavior
I have a feeling it may have to do with the fact that I'm using a nested array in the JSON source file. I know that arrays will work fine under an object key or property, but perhaps a nested array will cause problems?
Manage
->Repository Maintenance
and click onCommit
Expected behavior
Commits should be successful and pushed to the github repo.
Screenshots
No response
Exception traceback
How do you run Weblate?
PyPI module
Weblate versions
Weblate deploy checks
Additional context
No response
The text was updated successfully, but these errors were encountered: