avm-tools 0.78.0 → 0.79.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eec96ee906113345d8ef2b32945ccf9140141b63cdeaccb7b2f351762f338e82
|
4
|
+
data.tar.gz: 8f25aaa99149329fc034c040f45609b8eb078b2c547ab88d99c89dfd2b607135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1790d224e7b049c1aca352e2d4859ae9d48d80df3664aa2741654a56c70491e065380936e1d62f542b449aaf8de3e7e5d609985da830ebef6a24e4e392a75f99
|
7
|
+
data.tar.gz: 4e658ff31fcb8044695f44a20a8f0777eda5eb580ddaad93d7e63f1ecfb4676e3f284e8e8578a0c3d2db1b978f0a3754ec3c0709fbb7e80c50a903c718dd408b
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/patches/i18n'
|
4
|
+
|
5
|
+
class Class
|
6
|
+
TRANSLATE_LOCALE_KEY = :__locale
|
7
|
+
|
8
|
+
def translate(entry_suffix, values = {})
|
9
|
+
on_i18n_locale(values.delete(TRANSLATE_LOCALE_KEY)) do
|
10
|
+
::I18n.translate(translate_entry_full(entry_suffix), values)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def translate_entry_full(entry_suffix)
|
15
|
+
"#{translate_entry_self_prefix}.#{entry_suffix}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def translate_entry_self_prefix
|
19
|
+
name.underscore.gsub('/', '.')
|
20
|
+
end
|
21
|
+
|
22
|
+
def on_i18n_locale(locale)
|
23
|
+
old_locale = ::I18n.locale
|
24
|
+
begin
|
25
|
+
::I18n.locale = locale
|
26
|
+
yield
|
27
|
+
ensure
|
28
|
+
::I18n.locale = old_locale
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -1,17 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/patches/i18n'
|
3
|
+
require 'avm/patches/class/i18n'
|
4
4
|
|
5
5
|
class Object
|
6
6
|
def translate(entry_suffix, values = {})
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
def translate_entry_full(entry_suffix)
|
11
|
-
"#{translate_entry_self_prefix}.#{entry_suffix}"
|
12
|
-
end
|
13
|
-
|
14
|
-
def translate_entry_self_prefix
|
15
|
-
self.class.name.underscore.gsub('/', '.')
|
7
|
+
self.class.translate(entry_suffix, values)
|
16
8
|
end
|
17
9
|
end
|
@@ -1,12 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'avm/patches/class/i18n'
|
4
5
|
|
5
6
|
module Avm
|
6
7
|
module Projects
|
7
8
|
module Stereotypes
|
8
9
|
class RubyGem
|
9
10
|
class Update
|
11
|
+
TRANSLATE_CLASS = self
|
12
|
+
|
10
13
|
enable_console_speaker
|
11
14
|
common_constructor :instance
|
12
15
|
|
@@ -46,7 +49,7 @@ module Avm
|
|
46
49
|
end
|
47
50
|
|
48
51
|
def gemfile_lock_commit_message
|
49
|
-
|
52
|
+
TRANSLATE_CLASS.translate(__method__, __locale: instance.locale)
|
50
53
|
end
|
51
54
|
|
52
55
|
def gemfile_lock_changed?
|
data/lib/avm/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.79.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
@@ -434,6 +434,7 @@ files:
|
|
434
434
|
- lib/avm/local_projects.rb
|
435
435
|
- lib/avm/local_projects/instance.rb
|
436
436
|
- lib/avm/patches.rb
|
437
|
+
- lib/avm/patches/class/i18n.rb
|
437
438
|
- lib/avm/patches/eac_ruby_gems_utils/gem.rb
|
438
439
|
- lib/avm/patches/i18n.rb
|
439
440
|
- lib/avm/patches/object/i18n.rb
|