isomorfeus-i18n 22.9.0.rc1 → 22.9.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3893f1f4b352b6e2e6cb2ff85eae4c8ea8a47ae277c169124b2ed2142358693
4
- data.tar.gz: 782bf79faf33d6c4514f3e7d2cc3128a129d68ccbbb6c3849f783196079e37cc
3
+ metadata.gz: 0da2d72a216e3b42416b741c5135ef4cc4abace851c6f0d52c4d2f312fc246b1
4
+ data.tar.gz: d20f330be1b5f50f215fd21e1fe5d79a17cad3a35c28f66f994a3fd5d68d24dc
5
5
  SHA512:
6
- metadata.gz: dccc5bb3e1a44f8c7a5f7a68953b511390a9064d11ace5f7f23f840b25837034c084668384213843be64ec09491941265c38d097c6e7ab8ba36e14c29d91d2f6
7
- data.tar.gz: 7db066fed00ba4c942e417102015a8a985e6392a9813e87012c2aed9d9b4f0471ae37f331567f58309ed92551b731f0845b097d178d4936d0065fc71a256df58
6
+ metadata.gz: 394751e9d95f3d30e6dc24bd9b785035de3850f0cbe10b6ad5e78604f0a7d17351b6ee35353bea3309d8ba2db12992a08cc06002717a250d932cca6f6d8037c8
7
+ data.tar.gz: 9c72c1d20e74016d7df24a3789acdca8d603397a221589f5151f00a4450df3cb3cc687f005029866016bb3ff5bcf9fbf5c485b83a1f9f34d7cedb265b34f289f
@@ -34,14 +34,12 @@ module Isomorfeus
34
34
  end
35
35
  elsif action[:type] == 'I18N_INIT'
36
36
  locale = action[:locale]
37
- available_locales = FastGettext.available_locales
38
- domain = FastGettext.text_domain
39
37
  ne_locale = if Isomorfeus.available_locales.include?(locale)
40
38
  Isomorfeus.current_locale = locale
41
39
  else
42
40
  Isomorfeus.current_locale = Isomorfeus.default_locale
43
41
  end
44
- action = { type: 'I18N_MERGE', data: { available_locales: available_locales, domain: domain, locale: ne_locale }}
42
+ action = { type: 'I18N_MERGE', data: { domain: Isomorfeus.i18n_domain, locale: ne_locale }}
45
43
  end
46
44
  next_enh.call(action)
47
45
  end
@@ -1,33 +1,10 @@
1
1
  module Isomorfeus
2
2
  module I18n
3
- class StoreInit
4
- def self.init
5
- root_element = `document.querySelector('div[data-iso-root]')`
6
- if root_element
7
- Isomorfeus.current_locale = root_element.JS.getAttribute('data-iso-nloc')
8
- else
9
- Isomorfeus.current_locale = Isomorfeus.default_locale
10
- end
11
- end
12
- end
13
-
14
3
  class Init
15
4
  class << self
16
5
  if RUBY_ENGINE == 'opal'
17
6
  def init
18
- return if @initializing || initialized?
19
- @initializing = true
20
- @initialized = false
21
- init_from_server
22
- promise { Isomorfeus.store.dig(:i18n_state, :locale) }
23
- end
24
-
25
- def init_from_server
26
- Isomorfeus.store.deferred_dispatch(type: 'I18N_INIT', locale: Isomorfeus.current_locale)
27
- end
28
-
29
- def initialized?
30
- @initialized
7
+ Isomorfeus.current_locale = Isomorfeus.store.dig(:i18n_state, :locale)
31
8
  end
32
9
  else
33
10
  def init
@@ -26,9 +26,7 @@ module Isomorfeus
26
26
  else # RUBY_ENGINE
27
27
  SERVER_REDUCER = proc do |prev_state, action|
28
28
  action_type = action[:type]
29
- if action_type == 'I18N_STATE' && action.key?(:set_state)
30
- action[:set_state]
31
- elsif action_type == 'I18N_MERGE'
29
+ if action_type == 'I18N_MERGE'
32
30
  new_state = prev_state ? prev_state.deep_dup : {}
33
31
  new_state.deep_merge!(action[:data])
34
32
  new_state
@@ -1,5 +1,5 @@
1
1
  module Isomorfeus
2
2
  module I18n
3
- VERSION = '22.9.0.rc1'
3
+ VERSION = '22.9.0.rc3'
4
4
  end
5
5
  end
@@ -9,8 +9,7 @@ require 'lucid_i18n_mixin'
9
9
  require 'isomorfeus/i18n/init'
10
10
 
11
11
  if RUBY_ENGINE == 'opal'
12
- Isomorfeus.add_client_init_after_store_class_name('Isomorfeus::I18n::StoreInit')
13
- Isomorfeus.add_transport_init_class_name('Isomorfeus::I18n::Init')
12
+ Isomorfeus.add_client_init_after_store_class_name('Isomorfeus::I18n::Init')
14
13
  else
15
14
  require 'active_support'
16
15
  require 'oj'
@@ -89,6 +89,7 @@ module LucidI18nMixin
89
89
  c_name = object.class.to_s
90
90
  options = {} unless options
91
91
  locale = options.delete(:locale) { current_locale }
92
+ locale = `locale.toString()`
92
93
  options = options.transform_keys { |k| k.camelize(:lower) }
93
94
  if object.is_a?(Numeric)
94
95
  options[:minimumFractionDigits] = 4 unless object.is_a?(Integer)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.9.0.rc1
4
+ version: 22.9.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
@@ -114,28 +114,28 @@ dependencies:
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 22.9.0.rc1
117
+ version: 22.9.0.rc3
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 22.9.0.rc1
124
+ version: 22.9.0.rc3
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: isomorfeus-transport
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 22.9.0.rc1
131
+ version: 22.9.0.rc3
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: 22.9.0.rc1
138
+ version: 22.9.0.rc3
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: r18n-core
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - '='
158
158
  - !ruby/object:Gem::Version
159
- version: 22.9.0.rc1
159
+ version: 22.9.0.rc3
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: 22.9.0.rc1
166
+ version: 22.9.0.rc3
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rake
169
169
  requirement: !ruby/object:Gem::Requirement