mc_translator 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8df4b86675486570431856d5a8a58c608afcccb4603010670dba38a5319c401f
4
- data.tar.gz: 90ac2cd1d8e9f67ac41044a54eaa40f195c2ff63d32c291a9c1f5b4a83b3bcc2
3
+ metadata.gz: 80b8f221aa16654614846c559d380295c5ca71afbf18e306a18085c7e89b02d0
4
+ data.tar.gz: da07f2d730e9e6416020b8c37e96ef9667d55b8508aa40c6f9e17a3710e9bb1e
5
5
  SHA512:
6
- metadata.gz: 5b533b9881a2065743d0f20d4294ea4395237cde0cc24fab8c36b5d09906572240a582e3482ab01e2fd4d67c6e07be6330f366ee4c8f5c758371478d98fd9194
7
- data.tar.gz: d390634b64d849bf06d492dbb0a1c21a9d87015da5466a04b18e1a68dd8c27cee253a64d29b2283e8f5ce14cb610edeff068ffdb5ae1025212d7bfb8d80dd58c
6
+ metadata.gz: 5b55587ec90167d6a9b65773876ffac48ade1b9522117f04bbd4fe3dee83d436277aa20fe187c9dafd0f9e0443311bad90a9ebd947bb1debbca313d87cd924b7
7
+ data.tar.gz: 10c0338b1024008272b6e2d457190b0ea5af9077f0387cb740216039be6d14ae85f38928a9465bd2c8405d797f13b1c1656552b98dde4d696a0d4ac13ae15d38
data/README.md CHANGED
@@ -7,7 +7,9 @@ This gem is for pushing and pulling translations to and from Smartling.
7
7
  Add this line to your application's [Gemfile](https://github.com/yankaindustries/masterclass/blob/i18n/mc_translator/Gemfile#L188):
8
8
 
9
9
  ```ruby
10
- gem 'mc_translator', github: 'yankaindustries/mc_translator', branch: 'main', require: 'smartling'
10
+ # Gemfile
11
+ source "https://rubygems.org"
12
+ gem 'mc_translator', '~> 0.1.3'
11
13
  ```
12
14
 
13
15
  And then execute:
@@ -19,12 +21,14 @@ $ bundle install
19
21
  Then, in your [Rakefile](https://github.com/yankaindustries/masterclass/blob/i18n/mc_translator/Rakefile#L8):
20
22
 
21
23
  ```rb
22
- require 'mc_translator
24
+ # Rakefile
25
+ require 'mc_translator'
23
26
  ```
24
27
 
25
28
  Once you've got it installed, you'll need some basic configuration by adding a [.translations.yml](https://github.com/yankaindustries/masterclass/blob/i18n/mc_translator/.translator.yml):
26
29
 
27
30
  ```yaml
31
+ # .translations.yml
28
32
  userId: xxxxxxxxxxxxxxxxxx
29
33
  userSecret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
30
34
  projectId: xxxxxxx
@@ -43,11 +47,19 @@ parentBranch: master
43
47
  To keep things as simple as possible, we've added some Rake commands so that you can do this as simply as running:
44
48
 
45
49
  ```zsh
50
+ # Push only changed files (git) to Smartling
46
51
  $ rake translator:push
52
+
53
+ # Push all files that match to Smartling
54
+ $ rake translator:push:all
47
55
  ```
48
56
 
49
57
  and
50
58
 
51
59
  ```zsh
60
+ # Pull translated files related to a Smartling job with the same name as your branch
52
61
  $ rake translator:pull
62
+
63
+ # Pull all translated files in Smartling project that match config
64
+ $ rake translator:pull:all
53
65
  ```
data/lib/mc_translator.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  require_relative 'mc_translator/version'
4
4
  require_relative 'mc_translator/tasks'
5
5
  require_relative 'smartling/job'
6
+ require 'dotenv/load'
6
7
  require 'yaml'
7
8
  require 'git'
8
9
  require 'smartling'
@@ -19,9 +20,9 @@ module McTranslator
19
20
 
20
21
  def initialize
21
22
  args = {
22
- userId: config['userId'],
23
- userSecret: config['userSecret'],
24
- projectId: config['projectId'],
23
+ userId: ENV['SMARTLING_USER_ID'],
24
+ userSecret: ENV['SMARTLING_USER_SECRET'],
25
+ projectId: ENV['SMARTLING_PROJECT_ID'],
25
26
  }
26
27
 
27
28
  @files = Smartling::File.new(args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module McTranslator
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "git", "~> 1.8.1"
33
33
  spec.add_dependency "yaml", "~> 0.1.1"
34
34
  spec.add_dependency "smartling", "~> 2.0.3"
35
+ spec.add_dependency "dotenv"
35
36
 
36
37
  # For more information and examples about making a new gem, checkout our
37
38
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mc_translator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - justinjones53@gmail.com
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-13 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.0.3
55
+ - !ruby/object:Gem::Dependency
56
+ name: dotenv
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Translates locale files
56
70
  email:
57
71
  - justinjones53@gmail.com