crowdin / crowdin-cli-v1

A command-line client for the Crowdin API v1
MIT License
84 stars 29 forks source link

Ignore 0% translated languages when downloading #38

Open tasomaniac opened 8 years ago

tasomaniac commented 8 years ago

I can easily create mapping for translations.

We are a open source community project. In case people come and help for translation, we have some languages open in our crowdin page. Couple of them have 0% translation.

I want to ignore them when I am downloading from crowd-in. As far as I understand, it is impossible right now.

Andrulko commented 8 years ago

Yes, sorry - currently there is no possibility to export languages with at least 1 translation. As a solution, you can activate the "Skip untranslated strings" option in the project settings, then trim nearly empty languages on your side (I believe that languages without any translations will always have the same size in bytes).

tasomaniac commented 8 years ago

I cannot use skip untranslated strings because I need to have all the string keys for all languages.

What about having exclude parameters in crowdin.yaml file. I can provide those manually and then crowdin-cli can skip them.

rbioteau commented 8 years ago

Hi, we also need this feature for our project. Is it possible to select a specific language using the crowdin-cli ?

I know it's possible using the following rest api

GET https://api.crowdin.com/api/project/{project-identifier}/download/{package}.zip?key={project-key}

where package is the language code.

Thanks !

mamantoha commented 8 years ago

@rbioteau yes

crowdin-cli download -l <language_code>
rbioteau commented 8 years ago

Great ! Thank you.

tasomaniac commented 8 years ago

That's a great tip. Does it accept multiple language codes? We could put all the languages that we support. If not we could have a script calling it one by one.

On Tue, Oct 11, 2016, 13:27 Romain Bioteau notifications@github.com wrote:

Great ! Thank you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/crowdin/crowdin-cli/issues/38#issuecomment-252891613, or mute the thread https://github.com/notifications/unsubscribe-auth/AAuly1ZRXHuIlsCgI1xVYh51Oo0yfu1Tks5qy3KygaJpZM4HAWui .

mamantoha commented 8 years ago

Unfortunately, you can't because Crowdin API does not support this. But all contains only languages that are configured in the project. Of course, you can download each language separately. But I think the preferred way is to download all and leave only the necessary translations.

tasomaniac commented 8 years ago

That's true but it has started to be cumbersome. I run the script and remove unnecessary files which has 0 translation. Instead I would prefer just 1 script and nothing else.

The reason that we have languages with 0 translation is that we are keeping them in case somebody grant and translates in the future. I guess that's how most open source/volunteer projects use it.

I guess ideally there should be an option not to download files with 0 translation.

tasomaniac commented 8 years ago

I updated the title to indicate my problem more clearly. :)

mamantoha commented 8 years ago

I think you should ask Crowdin support is if possible to have this thing in the future. Maybe @Andrulko can answer?