crowdin-cli 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +79 -11
- data/bin/crowdin-cli +2 -1
- 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: 7b1766fba397653217212230ca31f870469ead4e
|
4
|
+
data.tar.gz: f408557bf4dccdeae6a8c64f803b490254fdd7ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d98f12a98e32c23e191cbeda55b88bec39ec55f583a2597e1d5522fd37495ef790739c27f7c363e3912db474d2738ff56d0ba6ee3c1744bfbb4fb36c911424
|
7
|
+
data.tar.gz: 163e14f379900c04c526efa76d683aeff6e2bb1a72c0eea7051163d05e255473148f7cc9a7b0a7c2d3b64882d34563fe7dfd8b80eff79e1b5df0ee9aa7f37333
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ files:
|
|
52
52
|
* `api_key` - Crowdin Project API key
|
53
53
|
* `project_identifier` - Crowdin project name
|
54
54
|
* `base_url` - (default: https://api.crowdin.com)
|
55
|
-
* `base_path` - defines what directory have to be
|
55
|
+
* `base_path` - defines what directory have to be scanned (default: current directory)
|
56
56
|
* `files`
|
57
57
|
* `source` - defines only files that should be uploaded as sources
|
58
58
|
* `translation` - defines where translations should be placed after downloading (also the path have to be checked to detect and upload existing translations)
|
@@ -80,11 +80,11 @@ files:
|
|
80
80
|
/locale/%two_letters_code%/LC_MESSAGES/%original_file_name%
|
81
81
|
```
|
82
82
|
|
83
|
-
|
83
|
+
You can also add and upload all directories matching the pattern, including all nested files and localizable files.
|
84
84
|
|
85
85
|
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.
|
86
86
|
|
87
|
-
Here
|
87
|
+
Here are the patterns you can use:
|
88
88
|
|
89
89
|
* `*` (asterisk)
|
90
90
|
|
@@ -108,7 +108,7 @@ Here's patterns you can use:
|
|
108
108
|
|
109
109
|
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%'`.
|
110
110
|
|
111
|
-
See sample configuration below
|
111
|
+
See sample configuration below:
|
112
112
|
```
|
113
113
|
---
|
114
114
|
project_identifier: test
|
@@ -127,23 +127,26 @@ files:
|
|
127
127
|
You could load the API Credentials from an environment variable, e.g.
|
128
128
|
|
129
129
|
```
|
130
|
-
api_key_env:
|
131
|
-
project_identifier_env:
|
130
|
+
api_key_env: CROWDIN_API_KEY
|
131
|
+
project_identifier_env: CROWDIN_PROJECT_ID
|
132
|
+
base_path_env: CROWDIN_BASE_PATH
|
132
133
|
|
133
134
|
```
|
134
135
|
|
135
|
-
If
|
136
|
+
If mixed, `api_key` and `project_identifier` have priority:
|
136
137
|
|
137
138
|
```
|
138
139
|
api_key_env: CROWDIN_API_KEY # Low priority
|
139
140
|
project_identifier_env: CROWDIN_PROJECT # Low priority
|
141
|
+
base_path_env: CROWDIN_BASE_PATH # Low priority
|
140
142
|
api_key: xxx # High priority
|
141
|
-
project_identifier: yyy #
|
143
|
+
project_identifier: yyy # High priority
|
144
|
+
base_path: zzz # High priority
|
142
145
|
```
|
143
146
|
|
144
147
|
### Split project configuration and user credentials
|
145
148
|
|
146
|
-
The `crowdin.yaml` file contains project-specific configuration and user credentials(`api_key`, `project_identifier`).
|
149
|
+
The `crowdin.yaml` file contains project-specific configuration and user credentials(`api_key`, `project_identifier`, `base_path`).
|
147
150
|
This means that you can't commit this file in the code repository, because the API key would leak to other users. `crowdin-cli` allow 2 configuration files:
|
148
151
|
|
149
152
|
* a project-specific, residing in the project directory (required)
|
@@ -402,8 +405,73 @@ Use help provided with an application to get more information about available co
|
|
402
405
|
|
403
406
|
Tested with the following Ruby versions:
|
404
407
|
|
405
|
-
- MRI
|
406
|
-
- JRuby
|
408
|
+
- MRI 2.2.1
|
409
|
+
- JRuby 9.0.0.0.pre2
|
410
|
+
|
411
|
+
## Creating a JAR file
|
412
|
+
|
413
|
+
Installation/SystemRequirements:
|
414
|
+
|
415
|
+
- Linux
|
416
|
+
- Java
|
417
|
+
- rvm
|
418
|
+
|
419
|
+
Install JRuby 9.0.0.0.pre2 and Warbler gem:
|
420
|
+
|
421
|
+
```
|
422
|
+
$ rvm install jruby-9.0.0.0.pre2
|
423
|
+
$ gem install warbler --pre
|
424
|
+
```
|
425
|
+
|
426
|
+
Create a new file called `Gemfile` in new project directory, an specify `crowdin-cli` version:
|
427
|
+
|
428
|
+
```ruby
|
429
|
+
source 'https://rubygems.org'
|
430
|
+
gem 'crowdin-api', '=0.3.0'
|
431
|
+
gem 'crowdin-cli', '=0.4.4'
|
432
|
+
```
|
433
|
+
|
434
|
+
Create a new file called `bin/crowdin-cli`:
|
435
|
+
|
436
|
+
```ruby
|
437
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
438
|
+
|
439
|
+
# The application 'crowdin-cli' is installed as part of a gem, and
|
440
|
+
# this file is here to facilitate running it.
|
441
|
+
#
|
442
|
+
|
443
|
+
require 'rubygems'
|
444
|
+
|
445
|
+
version = ">= 0"
|
446
|
+
|
447
|
+
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
|
448
|
+
version = $1
|
449
|
+
ARGV.shift
|
450
|
+
end
|
451
|
+
|
452
|
+
gem 'crowdin-cli', version
|
453
|
+
load Gem.bin_path('crowdin-cli', 'crowdin-cli', version)
|
454
|
+
```
|
455
|
+
|
456
|
+
Install dependencies:
|
457
|
+
|
458
|
+
```
|
459
|
+
$ bundle
|
460
|
+
```
|
461
|
+
|
462
|
+
Compile/package with warbler
|
463
|
+
|
464
|
+
```
|
465
|
+
$ warble jar
|
466
|
+
```
|
467
|
+
|
468
|
+
and rename `warbler.jar` to whatever you want.
|
469
|
+
|
470
|
+
Run jar in any computer with Java:
|
471
|
+
|
472
|
+
```
|
473
|
+
java -jar <myapp>.jar
|
474
|
+
```
|
407
475
|
|
408
476
|
## Contributing
|
409
477
|
|
data/bin/crowdin-cli
CHANGED
@@ -977,8 +977,9 @@ pre do |globals ,command, options, args|
|
|
977
977
|
#
|
978
978
|
# project_identifier_env: 'CROWDIN_PROJECT_ID'
|
979
979
|
# api_key_env: 'CROWDIN_API_KEY'
|
980
|
+
# base_path_env: 'CROWDIN_BASE_PATH'
|
980
981
|
#
|
981
|
-
['api_key', 'project_identifier'].each do |key|
|
982
|
+
['api_key', 'project_identifier', 'base_path'].each do |key|
|
982
983
|
if @config["#{key}_env"]
|
983
984
|
unless @config[key] # project credentials have a higher priority if they are specified in the config
|
984
985
|
@config[key] = ENV[@config["#{key}_env"]]
|
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.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Crowdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -86,20 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
90
|
-
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: 0.2.8
|
89
|
+
version: '0.3'
|
93
90
|
type: :runtime
|
94
91
|
prerelease: false
|
95
92
|
version_requirements: !ruby/object:Gem::Requirement
|
96
93
|
requirements:
|
97
94
|
- - "~>"
|
98
95
|
- !ruby/object:Gem::Version
|
99
|
-
version: '0.
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 0.2.8
|
96
|
+
version: '0.3'
|
103
97
|
- !ruby/object:Gem::Dependency
|
104
98
|
name: i18n
|
105
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.4.
|
153
|
+
rubygems_version: 2.4.6
|
160
154
|
signing_key:
|
161
155
|
specification_version: 4
|
162
156
|
summary: Crowdin CLI.
|