applocale-ruby 0.0.2 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +3 -3
- data/README.md +48 -10
- data/applocale-ruby.gemspec +2 -2
- data/lib/applocale/file_writer.rb +1 -1
- data/lib/applocale/pull.rb +2 -2
- data/lib/applocale/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 992e5cd3f0948c9f7cb7a20d8937d6ec62e1bd2b9f009260ca18f01e8770868d
|
4
|
+
data.tar.gz: 27138c786bd8aa1cba40b574ec316f0b9ba0ac1ed8101f5a0f12d576ecd59417
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb57f422b89498e5e095d2ddbe24e578cc04c278e33fca46f6ddad75c05b2a2cb880b3f9cfa3a1d386f33a1e4cfabdc330c4884f73f2273c9ac2528e97742d7
|
7
|
+
data.tar.gz: 81d5b21b2dc7bcbd5b1d1abea9d4c6dea6058ba77b4d0b59af1b4ae43b647ad5b990b1bb7bedc476cd72a64e1ea3fb31cbc699753aa39f78458f969565007865
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
applocale-ruby (0.0.
|
4
|
+
applocale-ruby (0.0.10)
|
5
5
|
httparty (~> 0.18.0)
|
6
|
-
thor (
|
6
|
+
thor (>= 0.18.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -13,7 +13,7 @@ GEM
|
|
13
13
|
multi_xml (>= 0.5.2)
|
14
14
|
mime-types (3.3.1)
|
15
15
|
mime-types-data (~> 3.2015)
|
16
|
-
mime-types-data (3.2020.
|
16
|
+
mime-types-data (3.2020.0512)
|
17
17
|
minitest (5.14.0)
|
18
18
|
multi_xml (0.6.0)
|
19
19
|
rake (10.5.0)
|
data/README.md
CHANGED
@@ -1,15 +1,31 @@
|
|
1
|
-
#
|
1
|
+
# AppLocale
|
2
2
|
|
3
|
-
Welcome to
|
3
|
+
Welcome to AppLocale's Ruby gem. This gem helps customers of AppLocale.dev to easily pull down their
|
4
|
+
latest translations with a simple `bundle exec applocale pull`.
|
4
5
|
|
5
|
-
|
6
|
+
Getting started with AppLocale will give you a free 14-day trial.
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
10
|
+
### With our RailsBytes application template:
|
11
|
+
|
12
|
+
This application template will install the gem for you, and walk you through setting up a configration file for your project. You'll need to login to your https://applocale.dev account, click on your avatar and click API Tokens to have the information ready for this step.
|
13
|
+
|
14
|
+
You should **always** review contents of scripts you run before hand, you may do so by visiting this url and reading the script: https://railsbytes.com/public/templates/X8Bsjj
|
15
|
+
|
16
|
+
```
|
17
|
+
rails app:template LOCATION="https://railsbytes.com/script/X8Bsjj"
|
18
|
+
```
|
19
|
+
|
20
|
+
### Manually:
|
21
|
+
|
9
22
|
Add this line to your application's Gemfile:
|
10
23
|
|
11
24
|
```ruby
|
12
|
-
|
25
|
+
|
26
|
+
group :development do
|
27
|
+
gem 'applocale-ruby'
|
28
|
+
end
|
13
29
|
```
|
14
30
|
|
15
31
|
And then execute:
|
@@ -20,20 +36,42 @@ Or install it yourself as:
|
|
20
36
|
|
21
37
|
$ gem install applocale-ruby
|
22
38
|
|
39
|
+
Then follow the instructions in Usage to setup your configuration file.
|
40
|
+
|
23
41
|
## Usage
|
24
42
|
|
25
|
-
|
43
|
+
Using AppLocale's gem requires a configuration file to be present. By default we assume this file to
|
44
|
+
live at `config/applocale.yml` but you can alternatively run each command with `--config-file=path-to-applocale.yml`
|
26
45
|
|
27
|
-
|
46
|
+
You'll need to login to your https://applocale.dev account, click on your avatar and click API Tokens to have the information ready for this step after creating an API Token and Project.
|
28
47
|
|
29
|
-
|
48
|
+
**Sample configuration file:**
|
30
49
|
|
31
|
-
|
50
|
+
```yaml
|
51
|
+
applocale:
|
52
|
+
project_id: 234qfewaf
|
53
|
+
api_key: API_KEY_HERE
|
54
|
+
locale_directory: "config/locales" # Default, you can override this if you wish.
|
55
|
+
```
|
56
|
+
|
57
|
+
Once you have your configuration file setup for your project you can proceed to use the following commands.
|
58
|
+
|
59
|
+
After that, to pull ALL your setup languages in AppLocale:
|
60
|
+
|
61
|
+
```
|
62
|
+
bundle exec applocale pull
|
63
|
+
```
|
64
|
+
|
65
|
+
Or just your specified languages:
|
66
|
+
|
67
|
+
```
|
68
|
+
bundle exec applocale en es
|
69
|
+
```
|
32
70
|
|
33
71
|
## Contributing
|
34
72
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
73
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/applocale/applocale-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
74
|
|
37
75
|
## Code of Conduct
|
38
76
|
|
39
|
-
Everyone interacting in the Applocale::Ruby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
77
|
+
Everyone interacting in the Applocale::Ruby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/applocale/applocale-ruby/blob/master/CODE_OF_CONDUCT.md).
|
data/applocale-ruby.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
18
|
spec.metadata["source_code_uri"] = "https://github.com/applocale/applocale-ruby"
|
19
|
-
spec.metadata["changelog_uri"] = "https://github.com/applocale/applocale-ruby"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/applocale/applocale-ruby/blob/master/CHANGELOG.md"
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.required_ruby_version = ">= 2.3.0"
|
31
31
|
|
32
32
|
spec.add_dependency 'httparty', '~> 0.18.0'
|
33
|
-
spec.add_dependency 'thor', '
|
33
|
+
spec.add_dependency 'thor', '>= 0.18.0'
|
34
34
|
|
35
35
|
spec.add_development_dependency "bundler", "~> 2.0"
|
36
36
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -8,7 +8,7 @@ module AppLocale
|
|
8
8
|
relative_file_path = "#{config.locale_directory}/#{response.dig('language_code')}.yml"
|
9
9
|
file_path = File.expand_path(relative_file_path)
|
10
10
|
File.write(file_path, response.dig('yaml'))
|
11
|
-
puts "[AppLocale] Wrote translations for #{response.dig('language_code')} to #{relative_file_path}"
|
11
|
+
puts "[AppLocale] ↳ Wrote translations for #{response.dig('language_code')} to #{relative_file_path}"
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
data/lib/applocale/pull.rb
CHANGED
@@ -8,7 +8,7 @@ module AppLocale
|
|
8
8
|
response = client.project_information
|
9
9
|
if response.dig("success")
|
10
10
|
languages = response.dig("languages")
|
11
|
-
puts "[AppLocale] Received #{languages} from AppLocale..." if options[:verbose]
|
11
|
+
puts "[AppLocale] ↳ Received #{languages} from AppLocale..." if options[:verbose]
|
12
12
|
else
|
13
13
|
puts "[AppLocale] #{response.dig('message')}"
|
14
14
|
exit 1
|
@@ -20,7 +20,7 @@ module AppLocale
|
|
20
20
|
puts "[AppLocale] Fetching translations for #{language_code}..."
|
21
21
|
response = client.export(language_code)
|
22
22
|
if response.dig("success")
|
23
|
-
puts "[AppLocale] Received #{response} from AppLocale" if options[:verbose]
|
23
|
+
puts "[AppLocale] ↳ Received #{response} from AppLocale" if options[:verbose]
|
24
24
|
AppLocale::FileWriter.new(config, options).call(response)
|
25
25
|
else
|
26
26
|
puts "[AppLocale] #{response.dig('message')}"
|
data/lib/applocale/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applocale-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Fomera
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.18.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.18.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,7 @@ extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
91
|
- ".gitignore"
|
92
|
+
- CHANGELOG.md
|
92
93
|
- CODE_OF_CONDUCT.md
|
93
94
|
- Gemfile
|
94
95
|
- Gemfile.lock
|
@@ -112,7 +113,7 @@ licenses: []
|
|
112
113
|
metadata:
|
113
114
|
homepage_uri: https://applocale.dev
|
114
115
|
source_code_uri: https://github.com/applocale/applocale-ruby
|
115
|
-
changelog_uri: https://github.com/applocale/applocale-ruby
|
116
|
+
changelog_uri: https://github.com/applocale/applocale-ruby/blob/master/CHANGELOG.md
|
116
117
|
post_install_message:
|
117
118
|
rdoc_options: []
|
118
119
|
require_paths:
|