alchemy_i18n 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +4 -0
- data/lib/alchemy_i18n/version.rb +1 -1
- data/lib/generators/alchemy_i18n/install/install_generator.rb +11 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ed0103c10c6bbf7d0fbf1b5ca7d68fc1a6760beb2ddbfc9ea65c8c9f9d7ca0
|
4
|
+
data.tar.gz: 54df22794d3b743094a2cb860794d31eb6398602c9b5ec1f54e619155d252704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c284b4fb443236d484ca5f94a252eb645bf5c3924853488a4331dd056e1545c01b5073b2befa828feea705cb179c9d43304cc811f0f25f0ea75ebd2c7baedcb1
|
7
|
+
data.tar.gz: f36a639f7a109dca0b445ee4670b08bd58f419f4d74efa175b5c4d20ba835e998d895cd4f8ff68c3a1591828b975158ef6536d1eacb61f8217e4cd0374f4e418
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v3.0.2](https://github.com/AlchemyCMS/alchemy_i18n/tree/v3.0.2) (2022-04-20)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/AlchemyCMS/alchemy_i18n/compare/v2.3.1...v3.0.2)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- Skip English for additional locales [\#46](https://github.com/AlchemyCMS/alchemy_i18n/pull/46) ([tvdeyen](https://github.com/tvdeyen))
|
10
|
+
|
3
11
|
## [v3.0.1](https://github.com/AlchemyCMS/alchemy_i18n/tree/v3.0.1) (2022-04-20)
|
4
12
|
|
5
13
|
[Full Changelog](https://github.com/AlchemyCMS/alchemy_i18n/compare/v3.0.0...v3.0.1)
|
@@ -28,6 +36,10 @@
|
|
28
36
|
- Add german node translations [\#37](https://github.com/AlchemyCMS/alchemy_i18n/pull/37) ([tvdeyen](https://github.com/tvdeyen))
|
29
37
|
- Allow Alchemy 6 [\#36](https://github.com/AlchemyCMS/alchemy_i18n/pull/36) ([afdev82](https://github.com/afdev82))
|
30
38
|
|
39
|
+
## [v2.3.1](https://github.com/AlchemyCMS/alchemy_i18n/tree/v2.3.1) (2022-04-20)
|
40
|
+
|
41
|
+
[Full Changelog](https://github.com/AlchemyCMS/alchemy_i18n/compare/v3.0.1...v2.3.1)
|
42
|
+
|
31
43
|
## [v2.3.0](https://github.com/AlchemyCMS/alchemy_i18n/tree/v2.3.0) (2021-10-26)
|
32
44
|
|
33
45
|
[Full Changelog](https://github.com/AlchemyCMS/alchemy_i18n/compare/v2.2.0...v2.3.0)
|
data/README.md
CHANGED
data/lib/alchemy_i18n/version.rb
CHANGED
@@ -9,7 +9,7 @@ module AlchemyI18n
|
|
9
9
|
desc "Installs Alchemy locales into your App."
|
10
10
|
|
11
11
|
def self.description
|
12
|
-
locales = Alchemy::I18n.available_locales.
|
12
|
+
locales = Alchemy::I18n.available_locales.to_sentence
|
13
13
|
"Available locales are #{locales}"
|
14
14
|
end
|
15
15
|
|
@@ -21,7 +21,7 @@ module AlchemyI18n
|
|
21
21
|
source_root AlchemyI18n::Engine.root
|
22
22
|
|
23
23
|
def append_assets
|
24
|
-
|
24
|
+
additional_locales.each do |locale|
|
25
25
|
append_file 'vendor/assets/javascripts/alchemy/admin/all.js', <<~ASSETS
|
26
26
|
//= require alchemy_i18n/#{locale}
|
27
27
|
//= require select2_locale_#{locale}
|
@@ -30,7 +30,7 @@ module AlchemyI18n
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def append_manifest
|
33
|
-
|
33
|
+
additional_locales.each do |locale|
|
34
34
|
append_file 'app/assets/config/manifest.js', <<~MANIFEST
|
35
35
|
//= link tinymce/langs/#{locale}.js
|
36
36
|
MANIFEST
|
@@ -40,7 +40,7 @@ module AlchemyI18n
|
|
40
40
|
def append_pack
|
41
41
|
webpack_config = YAML.load_file(Rails.root.join("config", "webpacker.yml"))[Rails.env]
|
42
42
|
pack = Rails.root.join(webpack_config["source_path"], webpack_config["source_entry_path"], "alchemy/admin.js")
|
43
|
-
|
43
|
+
additional_locales.each do |locale|
|
44
44
|
append_file pack, <<~PACK
|
45
45
|
import "flatpickr/dist/l10n/#{locale}.js"
|
46
46
|
PACK
|
@@ -49,7 +49,7 @@ module AlchemyI18n
|
|
49
49
|
|
50
50
|
def add_rails_i18n
|
51
51
|
environment do
|
52
|
-
"config.i18n.available_locales = #{locales.
|
52
|
+
"config.i18n.available_locales = #{locales.inspect}"
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -61,10 +61,14 @@ module AlchemyI18n
|
|
61
61
|
|
62
62
|
private
|
63
63
|
|
64
|
+
def additional_locales
|
65
|
+
@_additional_locales ||= locales.reject { |locale| locale == :en }
|
66
|
+
end
|
67
|
+
|
64
68
|
def locales
|
65
69
|
@_locales ||= begin
|
66
|
-
options[:locales].presence || ask_locales.split(
|
67
|
-
end
|
70
|
+
options[:locales].presence || ask_locales.split(" ")
|
71
|
+
end.map(&:to_sym)
|
68
72
|
end
|
69
73
|
|
70
74
|
def ask_locales
|