"Download only reviewed translations" doesn't seem to be working

I’m working on finding broken translations in the edx-platform project, and I’ve been unable to find a way to download just the reviewed translations.

When I visit https://www.transifex.com/open-edx/edx-platform/language/hi/ and select django-partial, I am given a number of options. The two most relevant ones seem to be “Download for use” and “Download only reviewed translations”. However, the resulting files are identical. Seems like a bug, no?

The problem is that there are currently some broken translations in the edx-platform project that are preventing us from updating the repository’s translation files, but most of the broken translations are unreviewed. (Specifically, some items have translated format-string identifiers, which need to be rejected.) If I try to inspect the .po file for this known type of error, I get about 130 instances of the error, but I believe that most of those are unreviewed; what I actually need is a way of finding only the reviewed ones that have this error.

Is this a bug? And either way, what approach should I take in the meantime?

Hello!

It seems like this is a bug; thank you so much for bringing this to us. Meanwhile this is fixed; an excellent workaround to get a file with only reviewed translations is through the API; You’ll need to perform the following steps:

  1. Use this endpoint to start the download file action and define the mode attribute as “reviewed” inside your request’s payload. You can use the below request on your terminal; it is ready to get the file you need; you only need to replace YOUR_TOKEN for your API token on the header. If you do not have a token, you can generate one by following these instructions. You must also replace “hy_AM” with the target language you want to download.
curl --location --request POST 'https://rest.api.transifex.com/resource_translations_async_downloads' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Accept: application/vnd.api+json' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--data-raw '{
    "data": {
        "type": "resource_translations_async_downloads",
        "relationships": {
            "resource": {
                "data": {
                    "type": "resources",
                    "id": "o:open-edx:p:edx-platform:r:django-partial"
                }
            },
            "language": {
                "data": {
                    "type": "languages",
                    "id": "l:hy_AM"
                }
            }
        },
        "attributes": {
            "callback_url": null,
            "content_encoding": "text",
            "file_type": "default",
            "mode": "reviewed",
            "pseudo": false
        }
    }
}'

The response should be something like this:

{
  "data": {
    "id": "YOUR_DOWNLOAD_ID",
    "type": "resource_translations_async_downloads",
    "attributes": {
      "status": "succeeded",
      "errors": [],
      "date_created": "2023-01-27T21:33:58Z",
      "date_modified": "2023-01-27T21:33:58Z"
    },
    "relationships": {
      "resource": {
        "links": {
          "related": "https://rest.api.transifex.com/resources/o:open-edx:p:edx-platform:r:django-partial"
        },
        "data": {
          "type": "resources",
          "id": "o:open-edx:p:edx-platform:r:django-partial"
        }
      },
      "language": {
        "links": {
          "related": "https://rest.api.transifex.com/languages/l:hy_AM"
        },
        "data": {
          "type": "languages",
          "id": "l:hy_AM"
        }
      }
    },
    "links": {
      "self": "https://rest.api.transifex.com/resource_translations_async_downloads/YOUR_DOWNLOAD_ID"
    }
  }
}
  1. You need to use this endpoint to download the translation file. Below you can see the request you must do, you can use it, just be sure to add your token and the download ID you got from the first request:
curl --location --request GET 'https://rest.api.transifex.com/resource_translations_async_downloads/YOUR_DOWNLOAD_ID' \
--header 'Authorization: Bearer YOUR_TOKEN'

If your answer looks like the following, you just need to retry a few seconds later:

{"errors":[{"status":"404","code":"not_found","title":"Object not found","detail":"Object not found. It may have been deleted or not been created yet"}]}

The successful answer should have the content of your file with only the reviewed strings translated; let me know if you have any issues.

1 Like