vipassana-design-standards 0.0.27 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vipassana/design_standards_helper.rb +19 -1
- 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: c40a856e403faa987189bdb0e6225a40efbba6f341a6b8de632344b235f7ee59
|
4
|
+
data.tar.gz: 681e69c76abacca8429e5c5a4f4df248bb186afe4c529643de0295b4593166b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6ca34b1433bc684d0d29b34fd5ad077c3941594a0a5efe3cfacd8d29939fe3a1f1ca0974bd4dbe0e118261e809418e63d6e36e2dab58e8798283573f21801c7
|
7
|
+
data.tar.gz: 3510621bc1a65ac5985d4123bad853abb3b9f8e0c9a946736653dc5febc58ab51a292c8302a863f02582669aeac62895d95e1f23d6cd3cba7a60cb04b7ebfb8e
|
@@ -3,6 +3,22 @@ module Vipassana
|
|
3
3
|
require "vipassana/logos_inline_svg.rb"
|
4
4
|
require "vipassana/translations.rb"
|
5
5
|
|
6
|
+
def fix_locale(locale)
|
7
|
+
mapping = {
|
8
|
+
'zh-Hans' => 'zh-HANS',
|
9
|
+
'zh-Hant'=> 'zh-HANT',
|
10
|
+
'zh-HK' => 'zh-HANT-HK',
|
11
|
+
'zh-CN' => 'zh-HANS',
|
12
|
+
'zh-TW' => 'zh-HANT',
|
13
|
+
}
|
14
|
+
if mapping[locale].present?
|
15
|
+
locale = mapping[locale] # zh-Hans -> zh-HANS
|
16
|
+
else
|
17
|
+
locale = locale.split("-").first # fr-CA -> fr
|
18
|
+
end
|
19
|
+
locale
|
20
|
+
end
|
21
|
+
|
6
22
|
def is_rtl?(locale)
|
7
23
|
locale.to_sym.in? [:ar, :fa, :he]
|
8
24
|
end
|
@@ -19,6 +35,7 @@ module Vipassana
|
|
19
35
|
end
|
20
36
|
|
21
37
|
def vds_bootstrap_theme_css_tag(locale: I18n.locale, localhost: false)
|
38
|
+
locale = fix_locale(locale)
|
22
39
|
tags = [
|
23
40
|
stylesheet_link_tag(vds_asset_url("css/bootstrap5-theme#{is_rtl?(locale) ? '.rtl' : ''}.min.css", localhost)),
|
24
41
|
]
|
@@ -31,11 +48,12 @@ module Vipassana
|
|
31
48
|
end
|
32
49
|
|
33
50
|
def vds_bootstrap_theme_js_tag(locale: I18n.locale, localhost: false)
|
51
|
+
locale = fix_locale(locale)
|
34
52
|
javascript_include_tag vds_asset_url("js/bootstrap5-theme.min.js", localhost)
|
35
53
|
end
|
36
54
|
|
37
55
|
def vds_logo(locale: I18n.locale, disposition: "default", size: '17', tagline: true, dark: false)
|
38
|
-
locale = locale
|
56
|
+
locale = fix_locale(locale)
|
39
57
|
trans = VDS_TRANSLATIONS[locale.to_sym] || VDS_TRANSLATIONS[:en]
|
40
58
|
|
41
59
|
if disposition == "mobile"
|