mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Translate value for 'familyFriendly'
This commit is contained in:
parent
6cdb6ec711
commit
ef309bd8d0
2 changed files with 10 additions and 1 deletions
|
@ -33,3 +33,12 @@ def translate(locale : Hash(String, JSON::Any) | Nil, translation : String, text
|
|||
|
||||
return translation
|
||||
end
|
||||
|
||||
def translate_bool(locale : Hash(String, JSON::Any) | Nil, translation : Bool)
|
||||
case translation
|
||||
when true
|
||||
return translate(locale, "Yes")
|
||||
when false
|
||||
return translate(locale, "No")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<% if !video.license.empty? %>
|
||||
<p id="License"><%= translate(locale, "License: ") %><%= video.license %></p>
|
||||
<% end %>
|
||||
<p id="FamilyFriendly"><%= translate(locale, "Family friendly? ") %><%= video.is_family_friendly %></p>
|
||||
<p id="FamilyFriendly"><%= translate(locale, "Family friendly? ") %><%= translate_bool(locale, video.is_family_friendly) %></p>
|
||||
<p id="Wilson"><%= translate(locale, "Wilson score: ") %><%= video.wilson_score.round(4) %></p>
|
||||
<p id="Rating"><%= translate(locale, "Rating: ") %><%= rating.round(4) %> / 5</p>
|
||||
<p id="Engagement"><%= translate(locale, "Engagement: ") %><%= engagement.round(2) %>%</p>
|
||||
|
|
Loading…
Reference in a new issue