isomorfeus-i18n 1.0.0.zeta12 → 1.0.0.zeta13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/i18n/config.rb +3 -3
- data/lib/isomorfeus/i18n/handler/locale_handler.rb +3 -3
- data/lib/isomorfeus/i18n/init.rb +1 -1
- data/lib/isomorfeus/i18n/version.rb +1 -1
- data/lib/lucid_translation/mixin.rb +10 -10
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d0229a14bcb4b888a5749419d2f12b4cde127f2df37cbc6b95c3bb17bee84a2
|
4
|
+
data.tar.gz: 2b8e9cec55f20bd7de916a66c69447cee8e1b83080df0ce1799e7194f8601ece
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 601351a404ed4e0c486d99ac727f4a58a893d465b2078319dd48af20951e3266dad75ac9e2bcb6e190e35fd8ad9f784eba9e8c583d8df7e678bf08f52d61e0f0
|
7
|
+
data.tar.gz: ee9798357888b41ca27350f9f9d904b2549088d0d2f1a916dac07e9e4d7c30aed5af357fe39da636e83b4edb911282a7593917f9c1cb52d67edcaa4086585164
|
@@ -25,7 +25,7 @@ module Isomorfeus
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def locale=(loc)
|
28
|
-
|
28
|
+
Isomorfeus.raise_error(message: "Locale #{loc} not available!") unless available_locales.include?(loc)
|
29
29
|
Isomorfeus.store.dispatch(type: 'I18N_LOAD', data: { locale: locale })
|
30
30
|
loc
|
31
31
|
end
|
@@ -61,7 +61,7 @@ module Isomorfeus
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def locale=(loc)
|
64
|
-
|
64
|
+
Isomorfeus.raise_error(message: "Locale #{loc} not available!") unless available_locales.include?(loc)
|
65
65
|
FastGettext.locale = loc
|
66
66
|
@locale = loc
|
67
67
|
end
|
@@ -76,4 +76,4 @@ module Isomorfeus
|
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
79
|
-
end
|
79
|
+
end
|
@@ -7,7 +7,7 @@ module Isomorfeus
|
|
7
7
|
include FastGettext::Translation
|
8
8
|
include FastGettext::TranslationMultidomain
|
9
9
|
|
10
|
-
on_request do |
|
10
|
+
on_request do |response_agent|
|
11
11
|
Isomorfeus::I18n::Init.init unless Thread.current[:isomorfeus_i18n_initialized] == true
|
12
12
|
response_agent.agent_result = {}
|
13
13
|
# promise_send_path('Isomorfeus::I18n::Handler::LocaleHandler', domain, locale, method, [args])
|
@@ -27,7 +27,7 @@ module Isomorfeus
|
|
27
27
|
FastGettext.with_domain(domain) do
|
28
28
|
response_agent.request[domain].each_key do |locale|
|
29
29
|
response_agent.agent_result[domain][locale] = {}
|
30
|
-
|
30
|
+
Isomorfeus.raise_error(message: "Locale #{locale} not available!") unless Isomorfeus.available_locales.include?(locale)
|
31
31
|
FastGettext.with_locale(locale) do
|
32
32
|
response_agent.request[domain][locale].each_key do |locale_method|
|
33
33
|
method_args = response_agent.request[domain][locale][locale_method]
|
@@ -53,7 +53,7 @@ module Isomorfeus
|
|
53
53
|
when 'Dp_' then Dp_(*method_args)
|
54
54
|
when 'Ds_' then Ds_(*method_args)
|
55
55
|
else
|
56
|
-
|
56
|
+
Isomorfeus.raise_error(message: "No such locale method #{locale_method}")
|
57
57
|
end
|
58
58
|
response_agent.agent_result[domain][locale].deep_merge!(locale_method => { Oj.dump(method_args, mode: :strict) => method_result })
|
59
59
|
end
|
data/lib/isomorfeus/i18n/init.rb
CHANGED
@@ -22,7 +22,7 @@ module Isomorfeus
|
|
22
22
|
agent.processed = true
|
23
23
|
if agent.response.key?(:error)
|
24
24
|
`console.error(#{agent.response[:error].to_n})`
|
25
|
-
|
25
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
26
26
|
end
|
27
27
|
@initializing = false
|
28
28
|
Isomorfeus.store.dispatch(type: 'I18N_LOAD', data: agent.response[:data])
|
@@ -16,7 +16,7 @@ module LucidTranslation
|
|
16
16
|
def _(*keys, &block)
|
17
17
|
domain = Isomorfeus.i18n_domain
|
18
18
|
locale = Isomorfeus.locale
|
19
|
-
|
19
|
+
Isomorfeus.raise_error(message: "I18n _(): no key given!") if keys.empty?
|
20
20
|
result = Redux.fetch_by_path(:i18n_state, domain, locale, '_', keys)
|
21
21
|
return result if result
|
22
22
|
if Isomorfeus::I18n::Init.initialized?
|
@@ -27,7 +27,7 @@ module LucidTranslation
|
|
27
27
|
agent.processed = true
|
28
28
|
if agent.response.key?(:error)
|
29
29
|
`console.error(#{agent.response[:error].to_n})`
|
30
|
-
|
30
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
31
31
|
end
|
32
32
|
Isomorfeus.store.merge_and_defer_dispatch(type: 'I18N_LOAD', data: { domain => agent.response[domain] })
|
33
33
|
end
|
@@ -39,7 +39,7 @@ module LucidTranslation
|
|
39
39
|
def n_(*keys, count, &block)
|
40
40
|
domain = Isomorfeus.i18n_domain
|
41
41
|
locale = Isomorfeus.locale
|
42
|
-
|
42
|
+
Isomorfeus.raise_error(message: "I18n n_(): no key given!") if keys.empty?
|
43
43
|
result = Redux.fetch_by_path(:i18n_state, domain, locale, 'n_', keys + [count])
|
44
44
|
return result if result
|
45
45
|
if Isomorfeus::I18n::Init.initialized?
|
@@ -50,7 +50,7 @@ module LucidTranslation
|
|
50
50
|
agent.processed = true
|
51
51
|
if agent.response.key?(:error)
|
52
52
|
`console.error(#{agent.response[:error].to_n})`
|
53
|
-
|
53
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
54
54
|
end
|
55
55
|
Isomorfeus.store.merge_and_defer_dispatch(type: 'I18N_LOAD', data: { domain => agent.response[domain] })
|
56
56
|
end
|
@@ -70,7 +70,7 @@ module LucidTranslation
|
|
70
70
|
def ns_(*args, &block)
|
71
71
|
domain = Isomorfeus.i18n_domain
|
72
72
|
locale = Isomorfeus.locale
|
73
|
-
|
73
|
+
Isomorfeus.raise_error(message: "I18n ns_(): no args given!") if args.empty?
|
74
74
|
result = Redux.fetch_by_path(:i18n_state, domain, locale, 'ns_', args)
|
75
75
|
return result if result
|
76
76
|
if Isomorfeus::I18n::Init.initialized?
|
@@ -81,7 +81,7 @@ module LucidTranslation
|
|
81
81
|
agent.processed = true
|
82
82
|
if agent.response.key?(:error)
|
83
83
|
`console.error(#{agent.response[:error].to_n})`
|
84
|
-
|
84
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
85
85
|
end
|
86
86
|
Isomorfeus.store.merge_and_defer_dispatch(type: 'I18N_LOAD', data: { domain => agent.response[domain] })
|
87
87
|
end
|
@@ -104,7 +104,7 @@ module LucidTranslation
|
|
104
104
|
agent.processed = true
|
105
105
|
if agent.response.key?(:error)
|
106
106
|
`console.error(#{agent.response[:error].to_n})`
|
107
|
-
|
107
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
108
108
|
end
|
109
109
|
Isomorfeus.store.merge_and_defer_dispatch(type: 'I18N_LOAD', data: { domain => agent.response[domain] })
|
110
110
|
end
|
@@ -127,7 +127,7 @@ module LucidTranslation
|
|
127
127
|
agent.processed = true
|
128
128
|
if agent.response.key?(:error)
|
129
129
|
`console.error(#{agent.response[:error].to_n})`
|
130
|
-
|
130
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
131
131
|
end
|
132
132
|
Isomorfeus.store.merge_and_defer_dispatch(type: 'I18N_LOAD', data: { domain => agent.response[domain] })
|
133
133
|
end
|
@@ -158,7 +158,7 @@ module LucidTranslation
|
|
158
158
|
define_method("D#{method}") do |*args, &block|
|
159
159
|
domain = Isomorfeus.i18n_domain
|
160
160
|
locale = Isomorfeus.locale
|
161
|
-
|
161
|
+
Isomorfeus.raise_error(message: "I18n D#{method}(): no args given!") if args.empty?
|
162
162
|
result = Redux.fetch_by_path(:i18n_state, domain, locale, "D#{method}", args)
|
163
163
|
return result if result
|
164
164
|
if Isomorfeus::I18n::Init.initialized?
|
@@ -169,7 +169,7 @@ module LucidTranslation
|
|
169
169
|
agent.processed = true
|
170
170
|
if agent.response.key?(:error)
|
171
171
|
`console.error(#{agent.response[:error].to_n})`
|
172
|
-
|
172
|
+
Isomorfeus.raise_error(message: agent.response[:error])
|
173
173
|
end
|
174
174
|
Isomorfeus.store.merge_and_defer_dispatch(type: 'I18N_LOAD', data: { domain => agent.response[domain] })
|
175
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.zeta13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 16.12.
|
103
|
+
version: 16.12.14
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 16.12.
|
110
|
+
version: 16.12.14
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: isomorfeus-redux
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,42 +128,42 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.0.0.
|
131
|
+
version: 1.0.0.zeta13
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.0.
|
138
|
+
version: 1.0.0.zeta13
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: isomorfeus-data
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.0.0.
|
145
|
+
version: 1.0.0.zeta13
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.0.0.
|
152
|
+
version: 1.0.0.zeta13
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: isomorfeus
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - '='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.0.0.
|
159
|
+
version: 1.0.0.zeta13
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.0.0.
|
166
|
+
version: 1.0.0.zeta13
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: opal-webpack-loader
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|