diff --git a/src/invidious/helpers/i18n.cr b/src/invidious/helpers/i18n.cr index c3d3fbf4..4c9bb2d6 100644 --- a/src/invidious/helpers/i18n.cr +++ b/src/invidious/helpers/i18n.cr @@ -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 diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 003d2396..2edeb7c2 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -106,7 +106,7 @@ <% if !video.license.empty? %>
<%= translate(locale, "License: ") %><%= video.license %>
<% end %> -<%= translate(locale, "Family friendly? ") %><%= video.is_family_friendly %>
+<%= translate(locale, "Family friendly? ") %><%= translate_bool(locale, video.is_family_friendly) %>
<%= translate(locale, "Wilson score: ") %><%= video.wilson_score.round(4) %>
<%= translate(locale, "Rating: ") %><%= rating.round(4) %> / 5
<%= translate(locale, "Engagement: ") %><%= engagement.round(2) %>%