crowdin-cli 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -16
- data/bin/crowdin-cli +14 -8
- data/lib/crowdin-cli/version.rb +1 -1
- metadata +5 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fae28d331be3e5cf9041a957ee91975650aa0996
|
4
|
+
data.tar.gz: f02916073ce264318ea11eab1655d14b404711f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d8a24010797eaeff3b862b74861e7e994450d76fd0f99bb7317fc4550309fa06c09aed00f9939ff9ff10385e747e3ff696aca77a5aef561b07425a53bb846f
|
7
|
+
data.tar.gz: beb712ce0fafd91181c842f1fe75cfb21504c08caf235bfae0b15c6a35b05aac097dc2c8624221c61dbfcd9bdc15a22e17f4c3a5681bdf4ab974553ee1ad5f40
|
data/README.md
CHANGED
@@ -5,13 +5,13 @@
|
|
5
5
|
[Crowdin.net Homepage](http://crowdin.net) |
|
6
6
|
[crowdin-api RubyDoc](http://rubydoc.info/github/crowdin/crowdin-api/)
|
7
7
|
|
8
|
-
A Command-Line Interface to sync files between
|
8
|
+
A Command-Line Interface to sync files between local computer/server and [Crowdin](crowdin.net).
|
9
9
|
|
10
|
-
It is cross-platform and
|
10
|
+
It is cross-platform and can be run in a terminal (Linux, MacOS X) or in cmd.exe (Windows).
|
11
11
|
|
12
12
|
![ScreenShot](https://raw.github.com/crowdin/crowdin-cli/master/screenshot.png)
|
13
13
|
|
14
|
-
> **WARNING**: This is a development version: It contains the latest changes, but may also have
|
14
|
+
> **WARNING**: This is a development version: It contains the latest changes, but may also have several known issues, including crashes and data loss situations. In fact, it may not work at all.
|
15
15
|
|
16
16
|
## Installation
|
17
17
|
|
@@ -26,16 +26,16 @@ And then execute:
|
|
26
26
|
$ bundle
|
27
27
|
```
|
28
28
|
|
29
|
-
Or install it
|
29
|
+
Or install it manually as:
|
30
30
|
```
|
31
31
|
$ gem install crowdin-cli
|
32
32
|
```
|
33
33
|
|
34
34
|
## Configuration
|
35
35
|
|
36
|
-
|
36
|
+
When the tool is installed, you would have to configure your project. Basically, `crowdin-cli` go through project directory, and looks for `crowdin.yaml` file that contains project information.
|
37
37
|
|
38
|
-
Create
|
38
|
+
Create `crowdin.yaml` YAML file in your root project directory with the following structure:
|
39
39
|
|
40
40
|
```
|
41
41
|
---
|
@@ -53,10 +53,10 @@ files:
|
|
53
53
|
* `api_key` - Crowdin Project API key
|
54
54
|
* `project_identifier` - Crowdin project name
|
55
55
|
* `base_url` - (default: http://api.crowdin.net)
|
56
|
-
* `base_path` - defines what directory
|
56
|
+
* `base_path` - defines what directory have to be scaned(default: current directory)
|
57
57
|
* `files`
|
58
|
-
* `source` - defines only files
|
59
|
-
* `translation` -
|
58
|
+
* `source` - defines only files that should be uploaded as sources
|
59
|
+
* `translation` - defines where translations should be placed after downloading (also the path have to be checked to detect and upload existing translations)
|
60
60
|
|
61
61
|
Use the following placeholders to put appropriate variables into the resulting file name:
|
62
62
|
* `%language%` - Language name (i.e. Ukrainian)
|
@@ -79,9 +79,9 @@ files:
|
|
79
79
|
/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%
|
80
80
|
```
|
81
81
|
|
82
|
-
Also you can add and upload all directories
|
82
|
+
Also you can add and upload all directories matching the pattern, including all nested files and localizable files.
|
83
83
|
|
84
|
-
|
84
|
+
Configuration example provided above has 'source' and 'translation' attributes containing standard wildcards (also known as globbing patterns) to make it easier to work with multiple files.
|
85
85
|
|
86
86
|
Here's patterns you can use:
|
87
87
|
|
@@ -91,7 +91,7 @@ Here's patterns you can use:
|
|
91
91
|
|
92
92
|
* `**` (doubled asterisk)
|
93
93
|
|
94
|
-
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 `/`.
|
94
|
+
Match all the 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 `/`.
|
95
95
|
|
96
96
|
* `?` (question mark)
|
97
97
|
|
@@ -171,7 +171,7 @@ files:
|
|
171
171
|
|
172
172
|
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.
|
173
173
|
|
174
|
-
|
174
|
+
Configuration sample is below:
|
175
175
|
|
176
176
|
```
|
177
177
|
---
|
@@ -203,7 +203,7 @@ files:
|
|
203
203
|
|
204
204
|
#### Multicolumn CSV
|
205
205
|
|
206
|
-
In case
|
206
|
+
In case CSV file contains translations to all target languages you can use per-file option `multilingual_spreadsheet`.
|
207
207
|
|
208
208
|
CSV file example:
|
209
209
|
```
|
@@ -226,7 +226,7 @@ files:
|
|
226
226
|
```
|
227
227
|
|
228
228
|
|
229
|
-
##
|
229
|
+
## Configurations Examples
|
230
230
|
|
231
231
|
### GetText Project
|
232
232
|
|
@@ -271,7 +271,7 @@ files:
|
|
271
271
|
|
272
272
|
## Usage
|
273
273
|
|
274
|
-
When the configuration file is created you are ready to start using `crowdin-cli` to manage your localization resources and automate files synchronization.
|
274
|
+
When the configuration file is created, you are ready to start using `crowdin-cli` to manage your localization resources and automate files synchronization.
|
275
275
|
|
276
276
|
We listed most typical commands that crowdin-cli is used for:
|
277
277
|
|
data/bin/crowdin-cli
CHANGED
@@ -207,13 +207,19 @@ end
|
|
207
207
|
# @params [Array] paths set of strings representing directory paths
|
208
208
|
#
|
209
209
|
def find_common_directory_path(paths)
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
210
|
+
case paths.length
|
211
|
+
when 0
|
212
|
+
return '/'
|
213
|
+
when 1
|
214
|
+
return paths.first.split('/').slice(0...-1).join('/')
|
215
|
+
else
|
216
|
+
arr = paths.sort
|
217
|
+
first = arr.first.split('/')
|
218
|
+
last = arr.last.split('/')
|
219
|
+
i = 0
|
220
|
+
i += 1 while first[i] == last[i] && i <= first.length
|
221
|
+
first.slice(0, i).join('/')
|
222
|
+
end
|
217
223
|
end
|
218
224
|
|
219
225
|
# Extract compressed files +files_list+ in a ZIP archive +zipfile_name+ to +dest_path+
|
@@ -591,7 +597,7 @@ EOS
|
|
591
597
|
puts "\rUploading translation file `#{file[:source].sub(@base_path, '')}' - OK"
|
592
598
|
end
|
593
599
|
else
|
594
|
-
puts "Warning: Local file `#{file[:source]}' does not
|
600
|
+
puts "Warning: Local file `#{file[:source]}' does not exist"
|
595
601
|
end
|
596
602
|
else
|
597
603
|
# if source file does not exist, don't upload translations
|
data/lib/crowdin-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crowdin-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Crowdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -104,22 +104,16 @@ dependencies:
|
|
104
104
|
name: i18n
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0.6'
|
110
107
|
- - ">="
|
111
108
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.6.
|
109
|
+
version: 0.6.9
|
113
110
|
type: :runtime
|
114
111
|
prerelease: false
|
115
112
|
version_requirements: !ruby/object:Gem::Requirement
|
116
113
|
requirements:
|
117
|
-
- - "~>"
|
118
|
-
- !ruby/object:Gem::Version
|
119
|
-
version: '0.6'
|
120
114
|
- - ">="
|
121
115
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0.6.
|
116
|
+
version: 0.6.9
|
123
117
|
description: A command-line interface to sync files between your computer/server and
|
124
118
|
Crowdin.
|
125
119
|
email:
|
@@ -156,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
150
|
version: '0'
|
157
151
|
requirements: []
|
158
152
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.2.
|
153
|
+
rubygems_version: 2.2.2
|
160
154
|
signing_key:
|
161
155
|
specification_version: 4
|
162
156
|
summary: Crowdin CLI.
|