remote_i18n_extension 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/remote_i18n_extension/install_generator.rb +3 -3
- data/lib/generators/templates/remote_i18n_extension_config.rb +1 -1
- data/lib/remote_i18n_extension/backend/remote.rb +2 -2
- data/lib/remote_i18n_extension/version.rb +2 -2
- data/lib/remote_i18n_extension.rb +7 -3
- data/remote_i18n_extension.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf4fb1faaaa8f463f224a5f46bb6fada00253c5d1d4c6e5ec866af416ac4b528
|
4
|
+
data.tar.gz: 1d54c59b731cde1e6ab83245f4904ac7676bfc57e90ff1368f46196a787744c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8665fee608326016e23267c2dde03c282bba3347f47cb7dd675905a96220ebb65bed12224e6f35e1da23bb0ebc0142225cff06839318df7bcd5750de860bcb1d
|
7
|
+
data.tar.gz: 957e8fb91ff43097aa26f12e29823e295fca2b10bea3aea125a4f96dc8e5873383131184536bda81f6826135cc6747d3f62400f39de847ce5b134f6c143dd0cf
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'rails/generators'
|
2
2
|
|
3
|
-
module
|
3
|
+
module RemoteI18nExtension
|
4
4
|
class InstallGenerator < Rails::Generators::Base
|
5
5
|
source_root File.expand_path('../templates', __dir__)
|
6
6
|
|
7
|
-
desc 'Creates config file for
|
7
|
+
desc 'Creates config file for RemoteI18nExtension'
|
8
8
|
|
9
9
|
def copy_config
|
10
|
-
template 'remote_i18n_extension_config.rb', "#{Rails.root}/config/remote_i18n_extension.rb"
|
10
|
+
template 'remote_i18n_extension_config.rb', "#{Rails.root}/config/initializers/remote_i18n_extension.rb"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'open-uri'
|
2
2
|
|
3
|
-
module
|
3
|
+
module RemoteI18nExtension
|
4
4
|
module Backend
|
5
5
|
class Remote < I18n::Backend::Simple
|
6
6
|
protected
|
@@ -35,7 +35,7 @@ module RemoteI18nExtensionHcc
|
|
35
35
|
private
|
36
36
|
|
37
37
|
def load_remote_locales(filename)
|
38
|
-
remote_host =
|
38
|
+
remote_host = RemoteI18nExtension.remote_host
|
39
39
|
URI.parse("#{remote_host}/#{filename}").read
|
40
40
|
end
|
41
41
|
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = '1.0.
|
1
|
+
module RemoteI18nExtension
|
2
|
+
VERSION = '1.0.2'.freeze
|
3
3
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'i18n'
|
2
2
|
require_relative 'remote_i18n_extension/backend/remote'
|
3
3
|
|
4
|
-
module
|
4
|
+
module RemoteI18nExtension
|
5
5
|
I18n.backend = I18n::Backend::Chain.new(
|
6
|
-
|
6
|
+
RemoteI18nExtension::Backend::Remote.new,
|
7
7
|
I18n::Backend::Simple.new
|
8
8
|
)
|
9
9
|
|
@@ -31,13 +31,17 @@ module RemoteI18nExtensionHcc
|
|
31
31
|
I18n.t(*args)
|
32
32
|
end
|
33
33
|
alias :t :translate
|
34
|
+
|
35
|
+
def reload!
|
36
|
+
I18n.reload!
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
private
|
37
41
|
|
38
42
|
def init_i18n_backend
|
39
43
|
I18n.backend = I18n::Backend::Chain.new(
|
40
|
-
|
44
|
+
RemoteI18nExtension::Backend::Remote.new,
|
41
45
|
I18n::Backend::Simple.new
|
42
46
|
)
|
43
47
|
end
|
@@ -2,12 +2,12 @@ require File.expand_path('lib/remote_i18n_extension/version', __dir__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'remote_i18n_extension'
|
5
|
-
spec.version =
|
5
|
+
spec.version = RemoteI18nExtension::VERSION
|
6
6
|
spec.authors = ['Hassan Ahmed']
|
7
7
|
spec.email = ['hassan91ahmed@gmail.com']
|
8
8
|
spec.summary = 'Support remote fetching of locales'
|
9
9
|
spec.description = 'Support remote fetching of locales'
|
10
|
-
spec.homepage = 'https://github.com/Gooner91/
|
10
|
+
spec.homepage = 'https://github.com/Gooner91/remote_i18n_extension'
|
11
11
|
spec.license = 'MIT'
|
12
12
|
spec.platform = Gem::Platform::RUBY
|
13
13
|
spec.required_ruby_version = '>=3.1.3'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote_i18n_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hassan Ahmed
|
@@ -97,7 +97,7 @@ files:
|
|
97
97
|
- lib/remote_i18n_extension/backend/remote.rb
|
98
98
|
- lib/remote_i18n_extension/version.rb
|
99
99
|
- remote_i18n_extension.gemspec
|
100
|
-
homepage: https://github.com/Gooner91/
|
100
|
+
homepage: https://github.com/Gooner91/remote_i18n_extension
|
101
101
|
licenses:
|
102
102
|
- MIT
|
103
103
|
metadata:
|