I’m trying to make sss_translate use the crowdin api instead of downloading via https://crowdin.com/backend/download/project/...
I’ve started running into issues with using https://crowdin.com/backend/download/project/... so I’m hoping the API will give me more control and information.
To use the API you need to authorize first, so you can’t export translations via API without providing a token. Kindly check more in our documentation: Crowdin API v2 Reference (File-based)
Do you have any idea why downloading via https://crowdin.com/backend/download/project/sss-translate.zip would be inconsistent?
Is this the URL to you exporting zip translations from the project? In case so, it should work consistently. If it’s giving empty files, maybe you don’t have newly added translations that you didn’t download yet or you have specific export options enabled in the project settings
Currently, I don’t see any error logs connected to the zip export translations. Please try exporting languages in several batches and check if it is working fine for you?
I’m not sure how I would go about downloading languages in batches, especially since I don’t know which languages are available before I download them.
It seems the issue is with the contents of the zip file, not that it’s actually empty:
java.util.zip.ZipInputStream can’t read it and behaves as though it’s empty.
if I try reading using org.apache.commons.compress.archivers.zip.ZipArchiveInputStream instead it gives an informative error:
java.util.zip.ZipException: Cannot find zip signature within the first 4096 bytes
Would you mind recording a video showing how you download translations and how the file is empty on the result and sending the video to support@crowdin.com?
Just to clarify, do you download translations via UI (translations tab) and get a 404 error and when you try to use API it also fails as you don’t use the API key?
Sorry for back and forth questions, just trying to understand all of your steps, so we can recreate the issue.
No, the issue isn’t occurring when I download via the UI.
There are two issues, both related to downloading via https://crowdin.com/backend/download/project/<project-slug>.zip, I don’t know if they’re related:
when I download from a url like that in sss_translate here, the file can’t be read by either java.util.zip.ZipInputStream or org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
when I navigate to a url like that in my browser, it usually fails the first try (it redirects me to https://crowdin.com/download/project/<project-slug>.zip and 404s); after the first try it starts a download as expected.
The problem I need help with is 1; 2 is just something I noticed while troubleshooting 1 and thought it might be relevant.
@supersaiyansubtlety
You’ve mentioned this:
"There are two issues, both related to downloading via https://crowdin.com/backend/download/project/<project-slug>.zip "
I’m not using the API because it doesn’t suite my needs: sss_translate cannot require users to provide authorization tokens (because it downloads translations at runtime, in production).
I don’t actually know where the https://crowdin.com/backend/download/project/<project-slug>.zip url came from, I picked up this project after it was abandoned by its former maintainer, and that url was part of the project.
If you go to that url in a browser it (usually) downloads a zip file containing the project’s translations. The file downloaded seems to be the same as what’s downloaded when you click “Build & Download” in the website UI (going to the url doesn’t cause the project to re-build, though). From what I can tell from searching the web for that url, the Crowdin UI used to have a “Download” button that used that url.
Each time you want to export translations, the new URL should be generating. Meaning, you won’t be able to use one url to always export translations as the system should update itself under the hood to apply ALL recent translations on export
In order to help you, we need to know which integration you’re using and how it was configured. As it may be that your set up requires some twigs and it runs with an error
I’m not using an integration.
I’m working on sss_translate, which I’ve linked many times now.
Each time you want to export translations, the new URL should be generating. Meaning, you won’t be able to use one url to always export translations as the system should update itself under the hood to apply ALL recent translations on export
This is demonstrably not true: please navigate to https://crowdin.com/backend/download/project/sss-translate.zip in your browser and observer that the most recently built translations download (you may have to try twice, as I’ve said, it sometimes redirects to a 404 on the first try).
I dumped the contents of the url stream to a file and found it’s the html for Crowdin’s login page.
Did Crowdin recently add a requirement to login before downloading a project build?
Is there a project setting that would allow downloading without logging in?
Hi!
We’re still investigating your case
As for your questions, there were no changes deployed regarding the downloading a project build. We don’t have settings to disable this. In order to export build you need to be logged in
I’m not sure what changed, but at least up until August 4 (probably even a little more recently than that, but I’m certain of August 4), I was able to download without logging in.
Maybe that was a bug?