smartling_rails 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +36 -0
- data/lib/smartling_rails/config.rb +2 -1
- data/lib/smartling_rails/smartling_processor.rb +1 -2
- data/lib/smartling_rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1505c53a3f7f9e487ef576420ae7761dfde132b8
|
4
|
+
data.tar.gz: 3f0432a00bf9102a6919686a23e57961e077b7d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ecf45e5d87f00363ab67eefe2458bbafab93deaee42de3c0b175d2c8f9d9eaf843d84c673eee7c044c4457a5ddfebc0e72b6e0b2b1e38f4eac02d80dd45b36a
|
7
|
+
data.tar.gz: 039b4ac5cb575c2bc9a26ad870ed9134884eb1faf1d716c6f4a9a9f3319e7186395b7e08fe50a2b180bb283e4a87fb38c04ccd9468433cef2f2e15fd756dfe9d
|
data/README.md
CHANGED
@@ -63,6 +63,42 @@ Fixing Issues:
|
|
63
63
|
|
64
64
|
```
|
65
65
|
|
66
|
+
## usage: rake commands
|
67
|
+
|
68
|
+
This gem comes fully equiped with rake commands to help leverage the gem from the command line.
|
69
|
+
|
70
|
+
Once you've installed the gem using `gem install smartling_rails` or by adding `gem 'smartling_rails', '~> 0.0.4'` to your **Gemfile** you can update your **Rakefile** with the following lines:
|
71
|
+
|
72
|
+
```
|
73
|
+
spec = Gem::Specification.find_by_name 'smartling_rails'
|
74
|
+
load "#{spec.gem_dir}/lib/tasks/smartling_rails.rake"
|
75
|
+
```
|
76
|
+
|
77
|
+
This will allow you to perform the following from the command line:
|
78
|
+
|
79
|
+
```
|
80
|
+
$> bundle exec rake -T
|
81
|
+
...
|
82
|
+
rake smartling:get # download the translations ...
|
83
|
+
rake smartling:put # upload the en-us.yml file...
|
84
|
+
rake smartling:status # check statuses
|
85
|
+
...
|
86
|
+
|
87
|
+
$> bundle exec rake smartling:put
|
88
|
+
$> bundle exec rake smartling:status
|
89
|
+
$> bundle exec rake smartling:status
|
90
|
+
Attempting to get translation statuses:
|
91
|
+
|
92
|
+
You are working with this remote file on smartling: /files/smartling-rails-[APPNAME]-[BRANCHNAME]-en-us.yml
|
93
|
+
Smartling Ruby client 0.5.1
|
94
|
+
|
95
|
+
Checking status for ["French fr-FR", "German de-DE", "Dutch nl-NL"]
|
96
|
+
fr-FR completed: false (158 / 161)
|
97
|
+
de-DE completed: true (161 / 161)
|
98
|
+
...
|
99
|
+
```
|
100
|
+
|
101
|
+
|
66
102
|
## structure
|
67
103
|
The smartling_rails gem consists of 3 components
|
68
104
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module SmartlingRails
|
2
2
|
class Config
|
3
|
-
attr_accessor :api_key, :project_id, :locales
|
3
|
+
attr_accessor :api_key, :project_id, :rails_app_name, :locales
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
#TODO source from yaml file
|
@@ -23,6 +23,7 @@ module SmartlingRails
|
|
23
23
|
key_val = line.split("=")
|
24
24
|
@api_key = key_val[1].strip if key_val[0] == 'SMARTLING_API_KEY'
|
25
25
|
@project_id = key_val[1].strip if key_val[0] == 'SMARTLING_PROJECT_ID'
|
26
|
+
@rails_app_name = key_val[1].strip if key_val[0] == 'SMARTLING_APP_NAME'
|
26
27
|
end
|
27
28
|
end unless !File.exist?('.env')
|
28
29
|
end
|
@@ -3,7 +3,6 @@ module SmartlingRails
|
|
3
3
|
attr_accessor :my_smartling
|
4
4
|
|
5
5
|
def initialize()
|
6
|
-
puts SmartlingRails.configuration
|
7
6
|
@my_smartling = Smartling::File.new(:apiKey => SmartlingRails.api_key, :projectId => SmartlingRails.project_id)
|
8
7
|
#@my_smartling = Smartling::File.sandbox(:apiKey => @@api_key, :projectId => @@project_id)
|
9
8
|
#puts @my_smartling.list
|
@@ -49,7 +48,7 @@ module SmartlingRails
|
|
49
48
|
end
|
50
49
|
|
51
50
|
def upload_file_path()
|
52
|
-
"/files/
|
51
|
+
"/files/[#{SmartlingRails.configuration.rails_app_name}]-[#{get_current_branch}]-en-us.yml"
|
53
52
|
end
|
54
53
|
|
55
54
|
def get_files
|