lato 3.13.6 → 3.13.7
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/app/controllers/lato/application_controller.rb +1 -4
- data/lib/lato/version.rb +1 -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: 8976259317d5a079213d204026d2bd75d0795041d93a93543c85866e657181e3
|
4
|
+
data.tar.gz: 0170ce764e25e59a4bd90d978ee7e7de65df2bc0ed72ff09c89ee096eb3a7686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5351a5e125361250739714e88b402bc31b4378c4fae7f30d59f6e5833d45c348a21c7a4442db6ab890fb38d5087b3ec0cc2052d93d4234e0d27d9e4a735e58f2
|
7
|
+
data.tar.gz: 3e5c8e0de47bcd852d83d001cc773b2ac445daea14f4c9d92473ffa840c39fd47db4b688a8de35cdc402c7c13d9ab56f621efba5a7a0befe138ead6b92959908
|
@@ -28,7 +28,6 @@ module Lato
|
|
28
28
|
|
29
29
|
def switch_locale
|
30
30
|
locale = I18n.available_locales.map(&:to_s).include?(params[:locale]) ? params[:locale] : I18n.default_locale.to_s
|
31
|
-
|
32
31
|
@session.user.update(locale: locale) if @session.valid?
|
33
32
|
cookies[:lato_locale] = { value: locale, expires: 1.year.from_now }
|
34
33
|
respond_to_redirect_same_page
|
@@ -46,9 +45,7 @@ module Lato
|
|
46
45
|
# This method set the default locale for the application.
|
47
46
|
# The default locale is the locale of the user if exists, otherwise is the default locale of the application.
|
48
47
|
def set_default_locale
|
49
|
-
|
50
|
-
|
51
|
-
I18n.locale = @session.user&.locale || cookies[:lato_locale] || I18n.default_locale
|
48
|
+
I18n.locale = (@session.valid? ? @session.user&.locale : nil) || cookies[:lato_locale] || I18n.default_locale
|
52
49
|
end
|
53
50
|
|
54
51
|
def respond_to_redirect_same_page(notice = nil)
|
data/lib/lato/version.rb
CHANGED