crowdin / crowdin-cli-v1

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

Language mapping not working #61

Closed thomasjoulin closed 6 years ago

thomasjoulin commented 6 years ago

It used to work, I'm not sure what changed since. My yaml file (iOS project):

project_identifier: REDACTED
api_key: REDACTED
base_path: .
files:
- source: "/Resources/en.lproj/*"
  translation: "/Resources/%osx_code%/%original_file_name%"
  languages_mapping:
    osx_code:
      es-MX: es.lproj
      pt-BR: pt.lproj
      zh-CN: zh-Hans.lproj
      zh-TW: zh-Hant.lproj

My files on crowdin are set to be exported following this format: /Resources/%osx_code%/%original_file_name%

All languages without mapping (like en) are put in their correct place. Languages with mapping (like es-MX) are not. I get an error like this:

$> crowdin-cli download
...
Warning: Downloaded translations do not match current project configuration. The following files will be omitted:
 - `Resources/zh-Hans.lproj/Localizable.strings'
 - `Resources/zh-Hans.lproj/Localizable.stringsdict'
 - `Resources/zh-Hans.lproj/InfoPlist.strings'
 - `Resources/zh-Hant.lproj/Localizable.strings'
 - `Resources/zh-Hant.lproj/Localizable.stringsdict'
 - `Resources/zh-Hant.lproj/InfoPlist.strings'
 - `Resources/pt-BR.lproj/Localizable.strings'
 - `Resources/pt-BR.lproj/Localizable.stringsdict'
 - `Resources/pt-BR.lproj/InfoPlist.strings'
 - `Resources/es-MX.lproj/Localizable.strings'
 - `Resources/es-MX.lproj/Localizable.stringsdict'
 - `Resources/es-MX.lproj/InfoPlist.strings'
... // other branches shows too like - `branch-name/Resources/pt-BR.lproj/InfoPlist.strings'

My local project file structure looks like this:

screen shot 2018-01-31 at 10 57 18 am

If I build and download from Crowdin website the structure looks like this:

screen shot 2018-01-31 at 10 59 16 am

Wondering if it's due to branches, in my example I do crowdin-cli download without branch param

mamantoha commented 6 years ago

Hi @thomasjoulin .

Thanks for reaching. First of all this client is deprecated in favor of https://github.com/crowdin/crowdin-cli-2. So if you want official support from Crowdin team you should switch to it. I've made some changes and update this client to version 0.6.0 which should fix this issue. You can update and try. But I can't guaranty this version will be compatible with the official client in the future. Let me know what you decide.

thomasjoulin commented 6 years ago

Thanks @mamantoha, I updated to 0.6.0 and it still doesn't work. But it works with crowdin-cli-2 so I'll go with that then :)

mamantoha commented 6 years ago

@thomasjoulin yeah. I've just tested with branches and have the same warning.

mamantoha commented 6 years ago

Basically, it's not an issue. It's just a warning and it fixed in 0.6.1