i18n-js 4.0.0.alpha1 → 4.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby-tests.yml +3 -15
- data/.rubocop.yml +5 -0
- data/README.md +4 -5
- data/exe/i18n +1 -1
- data/i18n-js.gemspec +1 -0
- data/lib/i18n-js/cli/export_command.rb +1 -1
- data/lib/i18n-js/cli.rb +7 -0
- data/lib/i18n-js/listen.rb +6 -5
- data/lib/i18n-js/version.rb +1 -1
- data/lib/i18n-js.rb +2 -8
- 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: 45e8592f190777f676916988517d474dffb4f18f09120df26733c947d63ca140
|
4
|
+
data.tar.gz: 04dfd46cfd05501a7cd1e97c5612a1ab5dbec52f98bad5f9119febcf28ce3ab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96caedcf824fb434a3b77dba666dd23cff72fbfd9f3d3175c928d768920d402f2d9250bb9ff0810e836ff5fbd90d3825b19621a4fd7c27ef10a7a40586990326
|
7
|
+
data.tar.gz: bc68a8b9e54c991dc21e50ca52986b2f5c39418e6aed3b48664efbcb501e8f34d7a1333a608d6de4b6d5d8bcf7f2fc3c2de5584123b47cc6873e29047da2fdfb
|
@@ -3,17 +3,7 @@ name: ruby-tests
|
|
3
3
|
|
4
4
|
on:
|
5
5
|
pull_request:
|
6
|
-
branches:
|
7
|
-
- main
|
8
|
-
|
9
6
|
push:
|
10
|
-
branches:
|
11
|
-
- main
|
12
|
-
- v4
|
13
|
-
|
14
|
-
schedule:
|
15
|
-
- cron: "0 10 * * *"
|
16
|
-
|
17
7
|
workflow_dispatch:
|
18
8
|
inputs: {}
|
19
9
|
|
@@ -24,7 +14,7 @@ jobs:
|
|
24
14
|
strategy:
|
25
15
|
fail-fast: false
|
26
16
|
matrix:
|
27
|
-
ruby: [2.
|
17
|
+
ruby: ["2.7", "3.0"]
|
28
18
|
gemfile:
|
29
19
|
- Gemfile
|
30
20
|
|
@@ -32,17 +22,15 @@ jobs:
|
|
32
22
|
- uses: actions/checkout@v1
|
33
23
|
|
34
24
|
- uses: actions/cache@v2
|
25
|
+
id: bundler-cache
|
35
26
|
with:
|
36
27
|
path: vendor/bundle
|
37
28
|
key: >
|
38
29
|
${{ runner.os }}-${{ matrix.ruby }}-gems-${{
|
39
30
|
hashFiles(matrix.gemfile) }}
|
40
|
-
restore-keys: >
|
41
|
-
${{ runner.os }}-${{ matrix.ruby }}-gems-${{
|
42
|
-
hashFiles(matrix.gemfile) }}
|
43
31
|
|
44
32
|
- name: Set up Ruby
|
45
|
-
uses:
|
33
|
+
uses: ruby/setup-ruby@v1
|
46
34
|
with:
|
47
35
|
ruby-version: ${{ matrix.ruby }}
|
48
36
|
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -99,11 +99,10 @@ Now you can run `guard start -i`.
|
|
99
99
|
Create a file under `config/initializers/i18n.rb` with the following content:
|
100
100
|
|
101
101
|
```ruby
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
I18nJS.listen
|
102
|
+
Rails.application.config.after_initialize do
|
103
|
+
require "i18n-js/listen"
|
104
|
+
I18nJS.listen
|
105
|
+
end
|
107
106
|
```
|
108
107
|
|
109
108
|
The code above will watch for changes based on `config/i18n.yml` and
|
data/exe/i18n
CHANGED
data/i18n-js.gemspec
CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = spec.summary
|
13
13
|
spec.license = "MIT"
|
14
14
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
15
|
+
spec.metadata = {"rubygems_mfa_required" => "true"}
|
15
16
|
|
16
17
|
github_url = "https://github.com/fnando/i18n-js"
|
17
18
|
github_tree_url = "#{github_url}/tree/v#{spec.version}"
|
data/lib/i18n-js/cli.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "../i18n-js"
|
4
|
+
require_relative "cli/command"
|
5
|
+
require_relative "cli/ui"
|
6
|
+
require_relative "cli/init_command"
|
7
|
+
require_relative "cli/version_command"
|
8
|
+
require_relative "cli/export_command"
|
9
|
+
|
3
10
|
module I18nJS
|
4
11
|
class CLI
|
5
12
|
attr_reader :ui
|
data/lib/i18n-js/listen.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
gem "listen"
|
4
|
-
require "listen"
|
5
|
-
require "i18n-js"
|
6
|
-
|
7
3
|
module I18nJS
|
8
4
|
class << self
|
9
5
|
attr_accessor :started
|
@@ -16,6 +12,10 @@ module I18nJS
|
|
16
12
|
return unless Rails.env.development?
|
17
13
|
return if started
|
18
14
|
|
15
|
+
gem "listen"
|
16
|
+
require "listen"
|
17
|
+
require "i18n-js"
|
18
|
+
|
19
19
|
self.started = true
|
20
20
|
|
21
21
|
relative_paths =
|
@@ -43,7 +43,7 @@ module I18nJS
|
|
43
43
|
@logger ||= ActiveSupport::TaggedLogging.new(Rails.logger)
|
44
44
|
end
|
45
45
|
|
46
|
-
def self.listener(config_file, locales_dir)
|
46
|
+
def self.listener(config_file, locales_dir)
|
47
47
|
paths = [File.dirname(config_file), locales_dir]
|
48
48
|
|
49
49
|
Listen.to(*paths) do |changed, added, removed|
|
@@ -58,6 +58,7 @@ module I18nJS
|
|
58
58
|
|
59
59
|
debug(changes.map {|key, value| "#{key}=#{value.inspect}" }.join(", "))
|
60
60
|
|
61
|
+
::I18n.backend.reload!
|
61
62
|
I18nJS.call(config_file: config_file)
|
62
63
|
end
|
63
64
|
end
|
data/lib/i18n-js/version.rb
CHANGED
data/lib/i18n-js.rb
CHANGED
@@ -7,14 +7,8 @@ require "glob"
|
|
7
7
|
require "fileutils"
|
8
8
|
require "optparse"
|
9
9
|
|
10
|
-
require_relative "
|
11
|
-
require_relative "
|
12
|
-
require_relative "./i18n-js/cli/ui"
|
13
|
-
require_relative "./i18n-js/cli/init_command"
|
14
|
-
require_relative "./i18n-js/cli/version_command"
|
15
|
-
require_relative "./i18n-js/cli/export_command"
|
16
|
-
require_relative "./i18n-js/schema"
|
17
|
-
require_relative "./i18n-js/version"
|
10
|
+
require_relative "i18n-js/schema"
|
11
|
+
require_relative "i18n-js/version"
|
18
12
|
|
19
13
|
module I18nJS
|
20
14
|
MissingConfigError = Class.new(StandardError)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glob
|
@@ -193,12 +193,13 @@ homepage: https://github.com/fnando/i18n-js
|
|
193
193
|
licenses:
|
194
194
|
- MIT
|
195
195
|
metadata:
|
196
|
+
rubygems_mfa_required: 'true'
|
196
197
|
homepage_uri: https://github.com/fnando/i18n-js
|
197
198
|
bug_tracker_uri: https://github.com/fnando/i18n-js/issues
|
198
|
-
source_code_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.
|
199
|
-
changelog_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.
|
200
|
-
documentation_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.
|
201
|
-
license_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.
|
199
|
+
source_code_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2
|
200
|
+
changelog_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2/CHANGELOG.md
|
201
|
+
documentation_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2/README.md
|
202
|
+
license_uri: https://github.com/fnando/i18n-js/tree/v4.0.0.alpha2/LICENSE.md
|
202
203
|
post_install_message:
|
203
204
|
rdoc_options: []
|
204
205
|
require_paths:
|
@@ -214,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
215
|
- !ruby/object:Gem::Version
|
215
216
|
version: 1.3.1
|
216
217
|
requirements: []
|
217
|
-
rubygems_version: 3.2.
|
218
|
+
rubygems_version: 3.2.32
|
218
219
|
signing_key:
|
219
220
|
specification_version: 4
|
220
221
|
summary: Export i18n translations and use them on JavaScript.
|