How I fixed Weblate not being able to commit changes
Problem
In my weblate instance, for one project, Weblate showed more than 1700 pending changes and clicking on Commit didn’t do anything (not even an error message).
The weblate logs contained messages like this:
example.txt
weblate-1 | [2025-11-16 23:16:08,059: WARNING/489] Could not parse template file on commit: FileParseError: Opening and ending tag mismatch: body line 4 and trans-unit, line 1540, column 20 (<string>, line 1540)
weblate-1 | [2025-11-16 23:16:08,060: ERROR/489] myproject/ui: skipping commit due to error: Opening and ending tag mismatch: body line 4 and trans-unit, line 1540, column 20 (<string>, line 1540)Solution
If Weblate is unable to commit, it is due to one of two reasons:
- (1) The git tree is somehow broken (e.g. a force push is neccessary). This is typically easy to fix by setting the
Version control systemtoGit with force pushin the settings (and, if needed, allowing the weblate git user to force push). - (2) There is a syntax error in one of the XLIFF files. Check this by uploading all XLIFF files (the source file and the translated files in all languages) to an XLIFF validator such as https://dev.maxprograms.com/Validation/.
In my case (2) was the problem: One of the translated XLIFF files contained a syntax error - not a missing closing tag, as indicated by the error message, but a & character that was not properly escaped as &. After fixing this in the source file, committing, pushing and Updating in Weblate’s repository maintenance, Weblate was able to commit & push the changes normally.
Check out similar posts by category:
Internationalization
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow