(i + 1).to_s, "total" => image_array.size.to_s})}" tabindex="0">
+
(i + 1).to_s, "total" => image_array.size.to_s})}" tabindex="0">
END_HTML
diff --git a/src/invidious/helpers/i18n.cr b/src/invidious/helpers/i18n.cr
index 8e2f7f44..23a1aafc 100644
--- a/src/invidious/helpers/i18n.cr
+++ b/src/invidious/helpers/i18n.cr
@@ -78,7 +78,7 @@ def load_all_locales
return locales
end
-def translate(locale : String?, key : String, text : String | Nil = nil, texts : Hash(String, String) | Nil = nil) : String
+def translate(locale : String?, key : String, text : String | Hash(String, String) | Nil = nil) : String
# Log a warning if "key" doesn't exist in en-US locale and return
# that key as the text, so this is more or less transparent to the user.
if !LOCALES["en-US"].has_key?(key)
@@ -101,10 +101,12 @@ def translate(locale : String?, key : String, text : String | Nil = nil, texts :
match_length = 0
raw_data.as_h.each do |hash_key, value|
- if md = text.try &.match(/#{hash_key}/)
- if md[0].size >= match_length
- translation = value.as_s
- match_length = md[0].size
+ if text.is_a?(String)
+ if md = text.try &.match(/#{hash_key}/)
+ if md[0].size >= match_length
+ translation = value.as_s
+ match_length = md[0].size
+ end
end
end
end
@@ -114,12 +116,12 @@ def translate(locale : String?, key : String, text : String | Nil = nil, texts :
raise "Invalid translation \"#{raw_data}\""
end
- if text
+ if text.is_a?(String)
translation = translation.gsub("`x`", text)
- elsif texts
+ elsif text.is_a?(Hash(String, String))
# adds support for multi string interpolation. Based on i18next https://www.i18next.com/translation-function/interpolation#basic
- texts.each_key do |hash_key|
- translation = translation.gsub("{{#{hash_key}}}", texts[hash_key])
+ text.each_key do |hash_key|
+ translation = translation.gsub("{{#{hash_key}}}", text[hash_key])
end
end
From a957b0fb7c517193dc9b20e7724feb46fe23912e Mon Sep 17 00:00:00 2001
From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
Date: Fri, 16 Feb 2024 16:22:43 -0500
Subject: [PATCH 3/3] remove trailing white spaces
---
assets/css/carousel.css | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/assets/css/carousel.css b/assets/css/carousel.css
index 8f0906d8..4bae92e5 100644
--- a/assets/css/carousel.css
+++ b/assets/css/carousel.css
@@ -1,24 +1,24 @@
/*
Copyright (c) 2024 by Jennifer (https://codepen.io/jwjertzoch/pen/JjyGeRy)
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify,
-merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is
+ including without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall
+The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
@@ -36,7 +36,7 @@ DEALINGS IN THE SOFTWARE.
scroll-snap-type: x mandatory;
scroll-behavior: smooth;
}
-
+
.slides::-webkit-scrollbar {
display: none;
}
@@ -116,4 +116,4 @@ DEALINGS IN THE SOFTWARE.
.no-theme .slider-nav {
background-color: #0005;
}
-}
\ No newline at end of file
+}