What I tried is to delete a translation unit via the web interface but I haven't found a possibility to do it.
I also searched the documentation for it but except the possibility to grant a user the right to delete, i haven't found anything.
Is there any possibility to delete a translation unit via the web interface?
It's not there. For some formats it doesn't make sense as the units are automatically extracted from the source code, but it might be useful for some. Additionally there is no API for units removal in the translate-toolkit (library we use to parse the files with translations), so it first would have to be supported there.
@nijel I think it makes sense to have a button that allows you to delete a translation from the interface, if you have the possibility to add a translation from the interface.
You say it doesn't make sense because the units are automatically extracted from the source code, so there should not be the possibility to add a translation. I think that if we can add, we should also be able to delete.
It goes together. One without the other doesn't really make sense.
It makes sense for monolingual translations, and typically doesn't make sense for bilingual ones (where Weblate does not support adding of strings).
In any case this feature is currently not supported by our backend library, so it needs more work to implement.
Ok, so what would you suggest to do if you need to remove a key from your monolingual base language file, if it's not possible to do it from the web interface ?
You can still edit the files in the repository.
I'm not saying this feature should not be implemented, it's just not there and it's currently not on the roadmap.
@nijel That's exactly what I did, but I encounter some issues...
I removed the translation from the monolingual base language file. Then I commit/push on the git branch. In Weblate interface I pull the changes, no problem. The translation was deleted in all language files.
Now I should be able to push the changes (translation removed from other files) in my branch to keep the other language files sync with the source file, but it's not possible because Weblate see no changes...
By default Weblate doesn't remove stale units from the other files to avoid accidental removal. If you want this to happen, install the Cleanup addon on your component.
I installed the Cleanup addon on my component. I think that it removed the unused units from the other files, but in the "Repository maintenance" there was no changes to commit.
I had to change a unit text to be able to commit and push the "removed units" change.
That's currently expected, the addon triggers only on repository update.
Anyway in case somebody would be looking into this issue, it's worth noting that strings removal for some of the formats is already present in the cleanup addon, so that could be used while making the implementation more generic.
I agree that removing a string via the webinterface would be a very useful (=required) improvement. There are usecases where you would want to both add strings (which is doable) and remove them or other strings again via the webinterface (currently not doable as i see it).
It would be definitely useful, it just needs to be implemented :-).
This issue has been added to the backlog. It is not scheduled on our roadmap, but it eventually might be implemented. In case you desperately need this feature, please consider helping or funding the development.
I'm also interested on having this feature 馃憤
Also waiting on this feature. :+1:
Also waiting on this feature. +1
Also waiting on this feature. +1 馃憤
Thank you for your report, the issue you have reported has just been fixed.
A question regarding this feature:
"KEY1" is gone from the English json source file as expected
"KEY1" is still present in the Danish json file - I expected it to be deleted here as well
I cannot find "KEY1" when searching in the web interface, so the only way I have found to remove it completely is to manually remove it from the Danish json file and upload that to weblate again.
Am I doing something wrong or did I misunderstand what this feature should do?
Thanks for a great product - it really makes handling translations much easier 馃憤
@rasmusvhansen You can enable the cleanup addon to remove stale translations from the files, otherwise they are kept to reduce damage from accidental removal.
Awesome, thanks :-)
Most helpful comment
It would be definitely useful, it just needs to be implemented :-).