vipassana-design-standards 0.0.27 → 0.0.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08662c3a3ba762db7933eb68d712e19515f3ea68c288c3e5e04ed875784fc9b4'
4
- data.tar.gz: 0ce7a5ea8cf20de51dd2e27f732a4ed19499a4e5a5c55a2342b4e1bf2ea08467
3
+ metadata.gz: 4c2f066293055453ddc983fb7db6e31d631ecb8fc98fe65122840a009c140bd0
4
+ data.tar.gz: a58ce6101b78570998a1a5b969ab7d487b78ab50dc2fb71278b65f17efaad4a4
5
5
  SHA512:
6
- metadata.gz: 9bd6745fa158a64b08f6b55012e295067aca7affde8c43d75825e1751e071c69c3c768a8b3fbb9a90ccea38c438cd8fe74203e1dffbf9c9c2872cd4017a15ea3
7
- data.tar.gz: 2d3d9d74930f7c852f5d858c6c7488819100000c65f2a8bf12691bfffd3ca173c7a421d873eb7db614f8a54f810bad92f6c0ba4703e334ac55619322498d61ff
6
+ metadata.gz: 915bb325891bf8829dc58245de22b6f529df8892bb0d047c90821b5d98bde620176eae8ccdb384484a52594c3a188c1c580ce57802d42c9144dc53498e718c4f
7
+ data.tar.gz: e3299f818c83d39563814ac871ad0c6ea4cd4ba5b9b807085ed0cb7f69249e5e58908ffb736abd59f5c7542b868159d4794ce691370ffb05d08e17b20cca3043
@@ -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.split("-").first
56
+ locale = fix_locale(locale)
39
57
  trans = VDS_TRANSLATIONS[locale.to_sym] || VDS_TRANSLATIONS[:en]
40
58
 
41
59
  if disposition == "mobile"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vipassana-design-standards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.27
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhamma workers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Provide a custom bootstrap theme, logos and icons according to the design
14
14
  standards of Vipassana Meditation as Taught yb S.N. Goenka