motion-phrase 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +36 -20
- data/lib/motion-phrase/api_client.rb +4 -3
- data/lib/motion-phrase/version.rb +1 -1
- data/motion-phrase.gemspec +1 -1
- metadata +20 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3dc6abe077a05dc5f2e079817f801f2562b5288f
|
4
|
+
data.tar.gz: 5fcc3c597bbb256c6960448e45c7ab28c239e5d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dc74b3b54092591416afad583cc41e78e684167c9ca96033ce602fee03baf9765622a78b705c0f19fe326267175b6e5ef1b7487c3712417901b223b8cba540ff
|
7
|
+
data.tar.gz: c6c3cd7eba18eaf453c4aa3902b76b8dd33e06faa770cb30fccfda5034836da1867a1d4cfb4427e349e9edaec2896220a7dbef67913593406e7258bf6376d7b6
|
data/README.md
CHANGED
@@ -28,22 +28,25 @@ Or install it yourself as:
|
|
28
28
|
|
29
29
|
Require the gem (unless you use bundler):
|
30
30
|
|
31
|
-
|
31
|
+
```ruby
|
32
|
+
require 'motion-phrase'
|
33
|
+
```
|
32
34
|
|
33
35
|
### Configure PhraseApp
|
34
36
|
|
35
37
|
Add the Auth Token to your application's Rakefile:
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
```ruby
|
40
|
+
Motion::Project::App.setup do |app|
|
41
|
+
app.name = "Test Application"
|
42
|
+
app.development do
|
43
|
+
app.phrase do
|
44
|
+
app.phrase.enabled = true
|
45
|
+
app.phrase.auth_token = "YOUR_AUTH_TOKEN"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
47
50
|
|
48
51
|
This will automatically create the `phrase_config.rb` configuration file in your app folder during every build process.
|
49
52
|
|
@@ -51,7 +54,9 @@ This will automatically create the `phrase_config.rb` configuration file in your
|
|
51
54
|
|
52
55
|
Now you can initialize your PhraseApp setup using rake:
|
53
56
|
|
54
|
-
|
57
|
+
```bash
|
58
|
+
rake phrase:init AUTH_TOKEN=YOUR_AUTH_TOKEN
|
59
|
+
```
|
55
60
|
|
56
61
|
This will:
|
57
62
|
|
@@ -70,20 +75,27 @@ Using PhraseApp with motion-phrase enables you to:
|
|
70
75
|
|
71
76
|
The first step towards a localized app is to localize all strings by extending them with their localized counterparts. This can be done by simply calling the `#__` method on each string that is implemented by motion-phrase:
|
72
77
|
|
73
|
-
|
78
|
+
```ruby
|
79
|
+
"Hello World"
|
80
|
+
```
|
74
81
|
|
75
82
|
now becomes:
|
76
83
|
|
77
|
-
|
84
|
+
```ruby
|
85
|
+
"Hello World".__
|
86
|
+
```
|
78
87
|
|
79
88
|
or (when using a fallback translation):
|
80
|
-
|
81
|
-
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
"Hello World".__("My fallback translation")
|
92
|
+
```
|
82
93
|
|
83
94
|
Of course you can use more generic names for your keys as well, such as:
|
84
95
|
|
85
|
-
|
86
|
-
|
96
|
+
```ruby
|
97
|
+
"HOME_WELCOME_BUTTON_LABEL".__
|
98
|
+
```
|
87
99
|
|
88
100
|
[Learn more about localization in iOS](https://developer.apple.com/internationalization/)
|
89
101
|
|
@@ -95,7 +107,9 @@ Simply build and run your app (in the simulator). When in development mode, moti
|
|
95
107
|
|
96
108
|
If you already have localization files in place, you can transmit them to PhraseApp by using the following rake command:
|
97
109
|
|
98
|
-
|
110
|
+
```bash
|
111
|
+
rake phrase:push
|
112
|
+
```
|
99
113
|
|
100
114
|
Simply execute this from inside your project directory and it will upload all Localizable.strings files that are found in your `resources` folder. All new keys and translation will be created in your PhraseApp project during the upload.
|
101
115
|
|
@@ -103,7 +117,9 @@ Simply execute this from inside your project directory and it will upload all Lo
|
|
103
117
|
|
104
118
|
Of course you want to include all recent translations in your application before releasing or testing it. Simply fetch all translations from PhraseApp using rake:
|
105
119
|
|
106
|
-
|
120
|
+
```bash
|
121
|
+
rake phrase:pull
|
122
|
+
```
|
107
123
|
|
108
124
|
This will download and replace all existing Localizable.strings files that sit in your `resources` folder. You can now build/test/release your application with the most recent localization files.
|
109
125
|
|
@@ -30,14 +30,15 @@ module MotionPhrase
|
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
33
|
-
def client
|
33
|
+
def client
|
34
34
|
@client ||= buildClient
|
35
35
|
end
|
36
36
|
|
37
37
|
def buildClient
|
38
38
|
AFMotion::Client.build_shared(API_BASE_URI) do
|
39
39
|
header "Accept", "application/json"
|
40
|
-
|
40
|
+
request_serializer :json
|
41
|
+
response_serializer :json
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
@@ -51,7 +52,7 @@ module MotionPhrase
|
|
51
52
|
|
52
53
|
def auth_token
|
53
54
|
if defined?(PHRASE_AUTH_TOKEN)
|
54
|
-
PHRASE_AUTH_TOKEN
|
55
|
+
PHRASE_AUTH_TOKEN
|
55
56
|
else
|
56
57
|
nil
|
57
58
|
end
|
data/motion-phrase.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
17
|
gem.require_paths = ["lib"]
|
18
18
|
gem.add_dependency 'phrase'
|
19
|
-
gem.add_dependency 'afmotion'
|
19
|
+
gem.add_dependency 'afmotion', '>= 2.0'
|
20
20
|
gem.add_dependency 'bubble-wrap'
|
21
21
|
gem.add_dependency 'motion-cocoapods'
|
22
22
|
gem.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,94 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-phrase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- PhraseApp
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-09-15 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: phrase
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: afmotion
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '0'
|
33
|
+
version: '2.0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '0'
|
40
|
+
version: '2.0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: bubble-wrap
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: motion-cocoapods
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rake
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
description: RubyMotion library for PhraseApp
|
@@ -98,7 +87,7 @@ executables: []
|
|
98
87
|
extensions: []
|
99
88
|
extra_rdoc_files: []
|
100
89
|
files:
|
101
|
-
- .gitignore
|
90
|
+
- ".gitignore"
|
102
91
|
- Gemfile
|
103
92
|
- LICENSE.txt
|
104
93
|
- README.md
|
@@ -111,26 +100,25 @@ files:
|
|
111
100
|
- motion-phrase.gemspec
|
112
101
|
homepage: https://github.com/phrase/motion-phrase
|
113
102
|
licenses: []
|
103
|
+
metadata: {}
|
114
104
|
post_install_message:
|
115
105
|
rdoc_options: []
|
116
106
|
require_paths:
|
117
107
|
- lib
|
118
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
-
none: false
|
120
109
|
requirements:
|
121
|
-
- -
|
110
|
+
- - ">="
|
122
111
|
- !ruby/object:Gem::Version
|
123
112
|
version: '0'
|
124
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
114
|
requirements:
|
127
|
-
- -
|
115
|
+
- - ">="
|
128
116
|
- !ruby/object:Gem::Version
|
129
117
|
version: '0'
|
130
118
|
requirements: []
|
131
119
|
rubyforge_project:
|
132
|
-
rubygems_version:
|
120
|
+
rubygems_version: 2.2.2
|
133
121
|
signing_key:
|
134
|
-
specification_version:
|
122
|
+
specification_version: 4
|
135
123
|
summary: Connect your RubyMotion application to PhraseApp for the best i18n experience
|
136
124
|
test_files: []
|