-
-
Notifications
You must be signed in to change notification settings - Fork 996
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
Changes in weblate are not written to actuall repository files #2218
Comments
The changes are written when needed, not immediately. You can force commit in the repository maintenance page or using |
Sorry I did not say that I was pushing commit button, which I guess is equal to |
Do you have setup celery if you're running master? Missing it might lead to some issues (though the commit button should still work). Does the repository maintenance tell something about pending changes? |
@nijel I did start celery via supervisor like this
since I had some issues figuring out how to properly set it up. Repository maintenance says that I have some uncommited changes after edit, but commit button just brings repository back to clean state without actually commiting anything.
|
The recommended setup is using redis as backend, see https://docs.weblate.org/en/latest/admin/install.html#celery Looks like the translations are somehow incosistent, can you try |
@nijel I use xliff and the command gave me this
After this command everything started to work as expected. Thank you. another thing is that my context fields started to look like this: My translation file look like this:
|
The handling of xliff files has changed at some point and it leads to this change. That's also why the updates could not be properly written. It seems that this change was not properly documented in the upgrade instructions, I'm really sorry for that. |
@nijel How do I see actual key in weblate now? the one I use in my app (ie |
You mean resname or source? The problem with it is that it doesn't have to be unique in the file, while You probably should be creating your translation component as monolingual, are you doing that? |
Yes, I use monolingual approach. My IDs are unique inside language file, though same key has equal IDs accross language files inside component. |
Looking at the specs it probably makes sense to use resname instead of id if that is available. That has to be fixed in the translate-toolkit though. I think following patch could do the trick, though I don't have currently time to test it: diff --git a/translate/storage/xliff.py b/translate/storage/xliff.py
index e3af1432..3e67d580 100644
--- a/translate/storage/xliff.py
+++ b/translate/storage/xliff.py
@@ -505,7 +505,7 @@ class xliffunit(lisa.LISAunit):
# unit has no proper file ancestor, probably newly created
pass
# hide the fact that we sanitize ID_SEPERATOR
- uid += six.text_type(self.xmlelement.get("id") or u"").replace(ID_SEPARATOR_SAFE, ID_SEPARATOR)
+ uid += six.text_type(self.xmlelement.get("resname") or self.xmlelement.get("id") or u"").replace(ID_SEPARATOR_SAFE, ID_SEPARATOR)
return uid
def addlocation(self, location): |
@nijel That does work, thank you for the great help. |
It will certainly work for loading, but I'm not sure if saving will work with this hack properly, please test that before thanking :-). |
See WeblateOrg/weblate#2218 Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel It does break saving. Now I noticed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Reopening as somebody else has ran into this issue as well: #2380 |
Thank you for your report, the issue you have reported has just been fixed.
|
I had several suggestions which I accepted and they were not saved to file. Is there a way to force to rewrite everything what is in the database? I have noticed this too late and now are a lot of translations missing. |
There is no simple way for that. What could work is marking all stings as pending, though I really haven't tested that it will work properly: from weblate.trans.models import Unit
from weblate.utils.state import STATE_TRANSLATED
Unit.objects.filter(
state=STATE_TRANSLATED,
translation__language__code='lang',
translation__component__slug='component',
translation__component__project__slug='project'
).update(pending=True) |
Not sure what happened, just yesterday all was working fine and now when I edit something in weblate it is not reflected in repository files, just nothing written to data folder.
I recieve no warnings, logs seem clean. What can I check?
Im on recent master version.
./manage.py check --deploy
output:Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: