Cannot exclude files with globs in crowdin.yaml

This page says wildcards can be used to ignore files:

You can also use wildcards to ignore files.
Configuration File | Crowdin Docs

However, I tried either of these in crowdin.yaml, but neither worked and files under .../testmod/... are still being uploaded:

files:
  - source: /*/src/*/resources/assets/*/lang/en_us.json
    translation: "%original_path%/%locale_with_underscore%.json"
    ignore: [/*/src/test*]
    # or
    ignore: [/*/src/test*/**/*]
preserve_hierarchy: true
project_id: "647524"

Here’s the relevant links:


Another question: Does a setup like that not delete sources on Crowdin when deleted on GitHub? Because this did not seem to happen…

Hi,

The reason your ignore pattern isn’t catching those files is due to how the Crowdin CLI parses mixed globs (like combining * and **/*) without quotation marks in the YAML file.

The most bulletproof way to ignore a specific subset of files is to mirror your exact source path pattern, but replace the specific wildcard with your exclusion string. Also, make sure to wrap the pattern in quotes so the YAML parser doesn’t misinterpret the asterisks.

Try updating your crowdin.yaml like this:

files:
  - source: "/*/src/*/resources/assets/*/lang/*.json"
    translation: "%original_path%/%locale_with_underscore%.json"
    ignore: 
      - "/*/src/test*/resources/assets/*/lang/en_not_us.json"

Regarding your second question: by default, Crowdin integrations and the GitHub Action do not delete files on the Crowdin side when they are deleted in your repository. This is a deliberate safety measure to prevent accidental data and translation loss. To force Crowdin to delete files, you need to use delete-obsolete

1 Like