diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-04-28 14:56:06 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-04-28 14:56:06 -0500 |
| commit | ef309bd8d0ce2793e14d89a98bd9815ac120fe15 (patch) | |
| tree | f1df0eb714cf86c87a83225af53cd7c636a5fe5c | |
| parent | 6cdb6ec711794c2887da03c0e5d3cfac67bded3f (diff) | |
| download | invidious-ef309bd8d0ce2793e14d89a98bd9815ac120fe15.tar.gz invidious-ef309bd8d0ce2793e14d89a98bd9815ac120fe15.tar.bz2 invidious-ef309bd8d0ce2793e14d89a98bd9815ac120fe15.zip | |
Translate value for 'familyFriendly'
| -rw-r--r-- | src/invidious/helpers/i18n.cr | 9 | ||||
| -rw-r--r-- | src/invidious/views/watch.ecr | 2 |
2 files changed, 10 insertions, 1 deletions
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? %> <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> |
