Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download sources finds no source files #412

Closed
jpmcosta opened this issue Dec 14, 2021 · 15 comments · Fixed by #434 or #433
Closed

Download sources finds no source files #412

jpmcosta opened this issue Dec 14, 2021 · 15 comments · Fixed by #434 or #433

Comments

@jpmcosta
Copy link

Describe the bug
Command download sources finds no source files to download.

To Reproduce
Steps to reproduce the behavior:

  1. Configuration file:
"project_id": "project_id"
"api_token": "api_token"
"preserve_hierarchy": true

"files": [
{
  "source": "/app/src/main/res/values/language.xml",
  "translation": "/app/src/main/res/values-%android_code%/%original_file_name%",
  "dest": "/Android/language.xml",
  "update_option": "update_as_unapproved"
}
]
  1. Execute CLI command:
java -jar <path_to>\crowdin-cli.jar download sources
  1. See an error
[OK] Fetching project info
[WARNING] No sources found for '\app\src\main\res\values\language.xml' pattern. Check the source paths in your configuration file

Expected behavior
File /app/src/main/res/values/language.xml should be updated from server.

Environment:

  • OS: Windows 10
  • Version 19042.1348

Additional context
I might be missing something simple, as I'm very inexperienced with Crowdin.
It seems I can download translations and upload sources.

@jpmcosta jpmcosta added the bug label Dec 14, 2021
@tattiza
Copy link

tattiza commented Dec 15, 2021

Hi there!
Already shared it with the tech team, once we have any updates - we'll let you know

@andrii-bodnar
Copy link
Member

Hi @jpmcosta!
Could you please check the version of CLI you using?

@jpmcosta
Copy link
Author

@andrii-bodnar I'm using the latest version, 3.7.3.

@andrii-bodnar
Copy link
Member

@jpmcosta thanks for clarifying

Does your source files were upload to Crowdin via CLI?

Do you have in your Crowdin project the /Android/language.xml file?

@jpmcosta
Copy link
Author

@andrii-bodnar no problem, I actually noticed I had forgotten to mention it.

I can confirm that java -jar <path_to>\crowdin-cli.jar upload updated the server's /Android/language.xml file.

@jpmcosta
Copy link
Author

@andrii-bodnar the local path to the file is slightly different, but I don't want to disclose it. It's something like

/<folder>/<folder>/src/main/res/values/language.xml

Server side is just that.

/Android/language.xml

@BigBerny
Copy link

BigBerny commented Feb 8, 2022

We have the same issue. Any news on that?

If we run crowdin list sources we get a result 'src/assets/i18n/en.json' but if we set that path in crowdin.yml ("source" : "src/assets/i18n/en.json") and run crowdin download sources, it says "No sources found for 'src/assets/i18n/en.json' pattern. Check the source paths in your configuration file"

This was linked to pull requests Feb 14, 2022
@bertho-zero
Copy link

bertho-zero commented Jul 4, 2022

I have the same error on ubuntu and the crowdin cli v3.7.8, crowdin list sources works fine but crowdin download sources give me Check the source paths in your configuration file errors

EDIT: I forgot to specify the branch (-b)

@andrii-bodnar
Copy link
Member

Hi @bertho-zero,

the list sources command lists all the source files in the Crowdin project, but the download sources command is based on the config patterns.

Please check if your config patterns match the Crowdin project files structure or try to download sources with the following parameter: crowdin download sources --all

@bertho-zero
Copy link

The branch option was missing, I have several branches on crowdin. Thank you for your response

@sz-liva
Copy link

sz-liva commented Oct 30, 2023

I have the same problem with crowdin CLI 3.15.0 on Windows 11 Pro. list sources works fine

crowdin list sources --identity .crowdin.yml --branch="releases-7.3.3"  --verbose
[OK] Fetching project info
[OK] File 'src\main\resources\translations\en\SuggestionTexts.properties'

but pull sources fails.

crowdin pull sources --identity .crowdin.yml --branch="releases-7.3.3"  --verbose
[OK] Fetching project info
[WARNING] No sources found for '\src\main\resources\translations\en\*' pattern. Check the source paths in your configuration file

The configuration is:

preserve_hierarchy: true
files:
  - source: /src/main/resources/translations/en/*
    translation: /src/main/resources/translations/%two_letters_code%/%original_file_name%
    escape_special_characters: 0
    escape_quotes: 0
    export_only_approved: true

I tried removing the first / from the source field in crowdin.yml but it didn't help.

@andrii-bodnar
Copy link
Member

@sz-liva: Is this issue reproducible on 3.14.0 or is this only a 3.15.0 issue?

@sz-liva
Copy link

sz-liva commented Oct 30, 2023

@andrii-bodnar I didn't try it on 3.14.0, but it is not reproducible on 3.15.0 under Linux. It looks like the problem is only under Windows.

@andrii-bodnar
Copy link
Member

andrii-bodnar commented Oct 30, 2023

@jpmcosta got you, thanks! Could you please create a separate issue for this?

@sz-liva
Copy link

sz-liva commented Oct 30, 2023

#679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants