transifex / transifex-client

The Transifex command-line tool.
https://www.transifex.com/
GNU General Public License v2.0
135 stars 75 forks source link

tx delete -r doesn't work #258

Closed tjerkw closed 2 years ago

tjerkw commented 5 years ago

I cannot delete resources.

I have a resouce in project "a". With resource "b". Then i execute tx delete -r a.b and it gives an error:

tx ERROR: Specified resource 'a.b' does not exist.

But it does exist!!!

tjerkw commented 5 years ago

I found out you can only delete resources that are defined in your transifex config. Not the resources that are available remote. This doesnt really work well with tx --branch

Zilus commented 5 years ago

The same here. I'm looking for a way to delete a branch related translation and been unable to do so.

Another approach, would be to delete by category, for example, deleting all resources pointing to branch "feature". I can't do that either.

emil-olsson commented 5 years ago

We're trying to do the exact same thing. This really makes it unpractical to work with branches.

Another approach, would be to delete by category, for example, deleting all resources pointing to branch "feature".

This, would be awesome ☝️

tejbirwason commented 4 years ago

Likewise, is there any workaround?

chenrui333 commented 3 years ago

Any update on this thread, I have run into the same issue.

jdknight commented 2 years ago

A workaround, if it helps.


Consider an example where you have an existing/active resource my-prj-pot with the most recent translation data and old resource message-pot you would like to delete. The contents of .tx/config may be as follows:

[main]
host = https://www.transifex.com

[my-org.my-prj-pot]
file_filter = <lang>/LC_MESSAGES/my-prj.po
minimum_perc = 0
source_file = my-prj.pot
source_lang = en
type = PO

If you want to remove an old resource from the command line (since it does not appear to be possible to always remove a resources from the web UI), append a new section entry which identifies the resource you want to delete:

[main]
host = https://www.transifex.com

[my-org.my-prj-pot]
file_filter = <lang>/LC_MESSAGES/my-prj.po
minimum_perc = 0
source_file = my-prj.pot
source_lang = en
type = PO

[my-org.message-pot]

(this can be done manually, or by doing a call such as echo "[my-org.message-pot]" >>.tx/config)

And if you request a delete, the resource will be removed from the organization as well as the recently duplicated entry in the configuration:

tx delete -r my-org.message-pot [--force]
 (or)
python -m txclib delete -r my-org.message-pot [--force]
nelefth commented 2 years ago

Hi all :)

As you may already know, GO CLI is the new CLI we released in 2021, and the sunset of the deprecated transifex-client has been scheduled for Nov 30, 2022.

Regarding the issue reported in this thread, I have some updates for you that I think you will find useful.

Specifically, with the GO CLI, the challenge mentioned above is addressed by using the delete command described here along with the --branch flag.

You can watch the video below where you can see how this option is used:

https://user-images.githubusercontent.com/13518557/180709305-e97f63fc-7c56-428c-baad-8932a4f6ccf1.mp4

I hope that this helps you achieve what you want.

For any questions, please do not hesitate to contact us.