README.md in crowdin-cli-0.2.1 vs README.md in crowdin-cli-0.2.2

- old
+ new

@@ -85,16 +85,28 @@ Here's patterns you can use: * `*` (asterisk) - Match zero or more characters in file name. A glob consisting of only the asterisk and no other characters will match all files in the directory. If you specified a `*.json` it will include all files like `messages.json`, `about_us.json` and anything that ends with `.json`. + Match zero or more characters in file name. A glob consisting of only the asterisk and no other characters will match all files in the directory. If you specified a `*.json` it will include all files like `messages.json`, `about_us.json` and anything that ends with `.json`.c* will match all files beginning with c; `*c` will match all files ending with c; and `*c*` will match all files that have c in them (including at the beginning or end). Equivalent to `/ .* /x` in regexp. * `**` (doubled asterisk) Match all directories recursively. Note that you can use `**` in `source` and in `translation` pattern. When using `**` in `translation` pattern it will always contain sub-path from `source` for certain file. The mask `**` can be used only once in the pattern and must be surrounded by backslashes `/`. +* `?` (question mark) + + Matches any one character. + +* `[set]` + + Matches any one character in set. Behaves exactly like character sets in `Regexp`, including set negation (`[^a-z]`). + +* `\` (backslash) + + Escapes the next metacharacter. + Say, you can have source: `/en/**/*.po` to upload all `*.po` files to Crowdin recursively. `translation` pattern will be `/translations/%two_letters_code%/**/%original_file_name%'`. See sample configuration below:: ``` --- @@ -138,23 +150,40 @@ You can also override language codes for other placeholders like `%android_code%`, `%locale%` etc... ### Ignoring directories -From time to time there are directories you don't want translate on Crowdin. +From time to time there are files and directories you don't want translate on Crowdin. Local per-file rules can be added to the config file in your project. + ``` files: - source: /locale/en/**/*.po translation: /locale/%two_letters_code%/**/%original_file_name% ignore: - /locale/en/templates - - /locale/en/workflow + - /locale/en/**/test-*.po + - /locale/en/**/[^abc]*.po ``` +### Preserving directories hierarchy + +By default CLI tool tries to optimize your Crowdin project hierarchy and do not repeats complete path of local files online. In case you need to keep directories structure same at Crowdin and locally you can add `preserve_hierarchy: true` option in main section of the configuration file. + +Sample configuration below: + +``` +--- +project_identifier: test +api_key: KeepTheAPIkeySecret +base_url: http://api.crowdin.net +base_path: /path/to/your/project +preserve_hierarchy: true +``` + ### Uploading CSV files via API ``` --- project_identifier: test @@ -293,6 +322,6 @@ Author: Anton Maminov (anton.maminov@gmail.com) Copyright: 2012-2013 [Crowdin.net](http://crowdin.net/) -This project is licensed under the MIT license, a copy of which can be found in the LICENSE file. \ No newline at end of file +This project is licensed under the MIT license, a copy of which can be found in the LICENSE file.