diff --git a/scripts/generate_js_licenses.cr b/scripts/generate_js_licenses.cr index 1f4ffa624..7df70bf2a 100644 --- a/scripts/generate_js_licenses.cr +++ b/scripts/generate_js_licenses.cr @@ -24,7 +24,7 @@ def create_licence_tr(path, file_name, licence_name, licence_link, source_locati " #{file_name} #{licence_name} - \#{translate(locale, "source")} + \#{I18n.translate(locale, "source")} " HTML diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index 659823255..64f0484df 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -38,7 +38,7 @@ struct ChannelVideo json.field "authorId", self.ucid json.field "authorUrl", "/channel/#{self.ucid}" json.field "published", self.published.to_unix - json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale)) + json.field "publishedText", I18n.translate(locale, "`x` ago", recode_date(self.published, locale)) json.field "viewCount", self.views end diff --git a/src/invidious/channels/community.cr b/src/invidious/channels/community.cr index 4256230cb..3761dde5d 100644 --- a/src/invidious/channels/community.cr +++ b/src/invidious/channels/community.cr @@ -131,7 +131,7 @@ def extract_channel_community(items, *, ucid, locale, format, thin_mode, is_sing json.field "contentHtml", content_html json.field "published", published.to_unix - json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale)) + json.field "publishedText", I18n.translate(locale, "`x` ago", recode_date(published, locale)) json.field "likeCount", like_count json.field "replyCount", reply_count diff --git a/src/invidious/comments/youtube.cr b/src/invidious/comments/youtube.cr index e923b2f8d..8b7987982 100644 --- a/src/invidious/comments/youtube.cr +++ b/src/invidious/comments/youtube.cr @@ -268,7 +268,7 @@ module Invidious::Comments end json.field "published", published.to_unix - json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale)) + json.field "publishedText", I18n.translate(locale, "`x` ago", recode_date(published, locale)) end if node_replies && !response["commentRepliesContinuation"]? diff --git a/src/invidious/frontend/channel_page.cr b/src/invidious/frontend/channel_page.cr index 4fe21b964..4af3b4f54 100644 --- a/src/invidious/frontend/channel_page.cr +++ b/src/invidious/frontend/channel_page.cr @@ -28,14 +28,14 @@ module Invidious::Frontend::ChannelPage if tab == selected_tab str << "\t" - str << translate(locale, "channel_tab_#{tab_name}_label") + str << I18n.translate(locale, "channel_tab_#{tab_name}_label") str << "\n" else # Video tab doesn't have the last path component url = tab.videos? ? base_url : "#{base_url}/#{tab_name}" str << %(\t) - str << translate(locale, "channel_tab_#{tab_name}_label") + str << I18n.translate(locale, "channel_tab_#{tab_name}_label") str << "\n" end diff --git a/src/invidious/frontend/comments_reddit.cr b/src/invidious/frontend/comments_reddit.cr index 4dda683ef..74d9d8d81 100644 --- a/src/invidious/frontend/comments_reddit.cr +++ b/src/invidious/frontend/comments_reddit.cr @@ -32,9 +32,9 @@ module Invidious::Frontend::Comments

[ − ] #{child.author} - #{translate_count(locale, "comments_points_count", child.score, NumberFormatting::Separator)} - #{translate(locale, "`x` ago", recode_date(child.created_utc, locale))} - #{translate(locale, "permalink")} + #{I18n.translate_count(locale, "comments_points_count", child.score, I18n::NumberFormatting::Separator)} + #{I18n.translate(locale, "`x` ago", recode_date(child.created_utc, locale))} + #{I18n.translate(locale, "permalink")}

#{body_html} diff --git a/src/invidious/frontend/comments_youtube.cr b/src/invidious/frontend/comments_youtube.cr index a0e1d783d..89d3caeff 100644 --- a/src/invidious/frontend/comments_youtube.cr +++ b/src/invidious/frontend/comments_youtube.cr @@ -6,10 +6,10 @@ module Invidious::Frontend::Comments root = comments["comments"].as_a root.each do |child| if child["replies"]? - replies_count_text = translate_count(locale, + replies_count_text = I18n.translate_count(locale, "comments_view_x_replies", child["replies"]["replyCount"].as_i64 || 0, - NumberFormatting::Separator + I18n::NumberFormatting::Separator ) replies_html = <<-END_HTML @@ -25,10 +25,10 @@ module Invidious::Frontend::Comments END_HTML elsif comments["authorId"]? && !comments["singlePost"]? # for posts we should display a link to the post - replies_count_text = translate_count(locale, + replies_count_text = I18n.translate_count(locale, "comments_view_x_replies", child["replyCount"].as_i64 || 0, - NumberFormatting::Separator + I18n::NumberFormatting::Separator ) replies_html = <<-END_HTML @@ -61,7 +61,7 @@ module Invidious::Frontend::Comments sponsor_icon = String.build do |str| str << %() end end @@ -110,14 +110,14 @@ module Invidious::Frontend::Comments when "multiImage" html << <<-END_HTML
\n" {% end %} end diff --git a/src/invidious/frontend/watch_page.cr b/src/invidious/frontend/watch_page.cr index 642ab4cc6..2f640e8cf 100644 --- a/src/invidious/frontend/watch_page.cr +++ b/src/invidious/frontend/watch_page.cr @@ -20,11 +20,11 @@ module Invidious::Frontend::WatchPage def download_widget(locale : String, video : Video, video_assets : VideoAssets) : String if CONFIG.disabled?("downloads") - return "

#{translate(locale, "Download is disabled")}

" + return "

#{I18n.translate(locale, "Download is disabled")}

" end if CONFIG.dmca_content.includes?(video.id) - return "

#{translate(locale, "dmca_content")}

" + return "

#{I18n.translate(locale, "dmca_content")}

" end url = "/download" @@ -49,7 +49,7 @@ module Invidious::Frontend::WatchPage str << "\t
\n" str << "\t\t\n" str << "\t\tvalue="<%= HTML.escape(query.text) %>"<% end %> - placeholder="<%= translate(locale, "Search for videos") %>"> + placeholder="<%= I18n.translate(locale, "Search for videos") %>"> diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index 132e636ce..a0fc47f57 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -35,10 +35,10 @@ <%= { "ucid" => ucid, - "youtube_comments_text" => HTML.escape(translate(locale, "View YouTube comments")), - "comments_text" => HTML.escape(translate(locale, "View `x` comments", "{commentCount}")), - "hide_replies_text" => HTML.escape(translate(locale, "Hide replies")), - "show_replies_text" => HTML.escape(translate(locale, "Show replies")), + "youtube_comments_text" => HTML.escape(I18n.translate(locale, "View YouTube comments")), + "comments_text" => HTML.escape(I18n.translate(locale, "View `x` comments", "{commentCount}")), + "hide_replies_text" => HTML.escape(I18n.translate(locale, "Hide replies")), + "show_replies_text" => HTML.escape(I18n.translate(locale, "Show replies")), "preferences" => env.get("preferences").as(Preferences) }.to_pretty_json %> diff --git a/src/invidious/views/components/channel_info.ecr b/src/invidious/views/components/channel_info.ecr index 97a2d7da2..9395000a4 100644 --- a/src/invidious/views/components/channel_info.ecr +++ b/src/invidious/views/components/channel_info.ecr @@ -27,7 +27,7 @@
-  <%= translate(locale, "generic_button_rss") %> +  <%= I18n.translate(locale, "generic_button_rss") %>
@@ -40,10 +40,10 @@
<%= Invidious::Frontend::ChannelPage.generate_tabs_links(locale, channel, selected_tab) %> @@ -53,9 +53,9 @@ <% sort_options.each do |sort| %>
<% if sort_by == sort %> - <%= translate(locale, sort) %> + <%= I18n.translate(locale, sort) %> <% else %> - <%= translate(locale, sort) %> + <%= I18n.translate(locale, sort) %> <% end %>
<% end %> diff --git a/src/invidious/views/components/feed_menu.ecr b/src/invidious/views/components/feed_menu.ecr index 3dbeaf371..aeaf183b7 100644 --- a/src/invidious/views/components/feed_menu.ecr +++ b/src/invidious/views/components/feed_menu.ecr @@ -5,7 +5,7 @@ <% end %> <% feed_menu.each do |feed| %> - <%= translate(locale, feed) %> + <%= I18n.translate(locale, feed) %> <% end %>
diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index a24423df9..ece2efe8a 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -27,8 +27,8 @@
<% if !item.channel_handle.nil? %>

<%= item.channel_handle %>

<% end %> -

<%= translate_count(locale, "generic_subscribers_count", item.subscriber_count, NumberFormatting::Separator) %>

- <% if !item.auto_generated && item.channel_handle.nil? %>

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

<% end %> +

<%= I18n.translate_count(locale, "generic_subscribers_count", item.subscriber_count, I18n::NumberFormatting::Separator) %>

+ <% if !item.auto_generated && item.channel_handle.nil? %>

<%= I18n.translate_count(locale, "generic_videos_count", item.video_count, I18n::NumberFormatting::Separator) %>

<% end %>
<%= item.description_html %>
<% when SearchHashtag %> <% if !thin_mode %> @@ -45,13 +45,13 @@
<%- if item.video_count != 0 -%> -

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

+

<%= I18n.translate_count(locale, "generic_videos_count", item.video_count, I18n::NumberFormatting::Separator) %>

<%- end -%>
<%- if item.channel_count != 0 -%> -

<%= translate_count(locale, "generic_channels_count", item.channel_count, NumberFormatting::Separator) %>

+

<%= I18n.translate_count(locale, "generic_channels_count", item.channel_count, I18n::NumberFormatting::Separator) %>

<%- end -%>
<% when SearchPlaylist, InvidiousPlaylist %> @@ -73,7 +73,7 @@ <%- end -%>
-

<%= translate_count(locale, "generic_videos_count", item.video_count, NumberFormatting::Separator) %>

+

<%= I18n.translate_count(locale, "generic_videos_count", item.video_count, I18n::NumberFormatting::Separator) %>

@@ -101,11 +101,11 @@
-

<%=translate(locale, "timeline_parse_error_placeholder_heading")%>

-

<%=translate(locale, "timeline_parse_error_placeholder_message")%>

+

<%=I18n.translate(locale, "timeline_parse_error_placeholder_heading")%>

+

<%=I18n.translate(locale, "timeline_parse_error_placeholder_message")%>

- <%=translate(locale, "timeline_parse_error_show_technical_details")%> + <%=I18n.translate(locale, "timeline_parse_error_show_technical_details")%>
<%=get_issue_template(env, item.parse_exception)[1]%>
@@ -168,7 +168,7 @@
<%- if item.responds_to?(:live_now) && item.live_now -%> -

 <%= translate(locale, "LIVE") %>

+

 <%= I18n.translate(locale, "LIVE") %>

<%- elsif item.length_seconds != 0 -%>

<%= recode_length_seconds(item.length_seconds) %>

<%- end -%> @@ -200,15 +200,15 @@
<% if item.responds_to?(:premiere_timestamp) && item.premiere_timestamp.try &.> Time.utc %> -

<%= translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>

+

<%= I18n.translate(locale, "Premieres in `x`", recode_date((item.premiere_timestamp.as(Time) - Time.utc).ago, locale)) %>

<% elsif item.responds_to?(:published) && (Time.utc - item.published) > 1.minute %> -

<%= translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>

+

<%= I18n.translate(locale, "Shared `x` ago", recode_date(item.published, locale)) %>

<% end %>
<% if item.responds_to?(:views) && item.views %>
-

<%= translate_count(locale, "generic_views_count", item.views || 0, NumberFormatting::Short) %>

+

<%= I18n.translate_count(locale, "generic_views_count", item.views || 0, I18n::NumberFormatting::Short) %>

<% end %>
diff --git a/src/invidious/views/components/items_paginated.ecr b/src/invidious/views/components/items_paginated.ecr index f69df3fe0..bb630d621 100644 --- a/src/invidious/views/components/items_paginated.ecr +++ b/src/invidious/views/components/items_paginated.ecr @@ -11,9 +11,9 @@ diff --git a/src/invidious/views/components/search_box.ecr b/src/invidious/views/components/search_box.ecr index 29da2c523..f957c25cd 100644 --- a/src/invidious/views/components/search_box.ecr +++ b/src/invidious/views/components/search_box.ecr @@ -2,11 +2,11 @@
autofocus<% end %> - name="q" placeholder="<%= translate(locale, "search") %>" - title="<%= translate(locale, "search") %>" + name="q" placeholder="<%= I18n.translate(locale, "search") %>" + title="<%= I18n.translate(locale, "search") %>" value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
- diff --git a/src/invidious/views/components/subscribe_widget.ecr b/src/invidious/views/components/subscribe_widget.ecr index 3cfcb0ebd..742e9a82a 100644 --- a/src/invidious/views/components/subscribe_widget.ecr +++ b/src/invidious/views/components/subscribe_widget.ecr @@ -3,14 +3,14 @@
" method="post"> ">
<% else %>
" method="post"> ">
<% end %> @@ -22,8 +22,8 @@ "author" => HTML.escape(author), "sub_count_text" => HTML.escape(sub_count_text), "csrf_token" => URI.encode_www_form(env.get?("csrf_token").try &.as(String) || ""), - "subscribe_text" => HTML.escape(translate(locale, "Subscribe")), - "unsubscribe_text" => HTML.escape(translate(locale, "Unsubscribe")) + "subscribe_text" => HTML.escape(I18n.translate(locale, "Subscribe")), + "unsubscribe_text" => HTML.escape(I18n.translate(locale, "Unsubscribe")) }.to_pretty_json %> @@ -31,6 +31,6 @@ <% else %> "> - <%= translate(locale, "Subscribe") %> | <%= sub_count_text %> + <%= I18n.translate(locale, "Subscribe") %> | <%= sub_count_text %> <% end %> diff --git a/src/invidious/views/components/video-context-buttons.ecr b/src/invidious/views/components/video-context-buttons.ecr index 22458a030..103e7cda9 100644 --- a/src/invidious/views/components/video-context-buttons.ecr +++ b/src/invidious/views/components/video-context-buttons.ecr @@ -1,21 +1,21 @@
-
\ No newline at end of file +
diff --git a/src/invidious/views/create_playlist.ecr b/src/invidious/views/create_playlist.ecr index 807244e6d..feff65221 100644 --- a/src/invidious/views/create_playlist.ecr +++ b/src/invidious/views/create_playlist.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Create playlist") %> - Invidious +<%= I18n.translate(locale, "Create playlist") %> - Invidious <% end %>
@@ -8,25 +8,25 @@
- <%= translate(locale, "Create playlist") %> + <%= I18n.translate(locale, "Create playlist") %>
- - "> + + ">
- +
diff --git a/src/invidious/views/delete_playlist.ecr b/src/invidious/views/delete_playlist.ecr index cd66b9630..6e296153e 100644 --- a/src/invidious/views/delete_playlist.ecr +++ b/src/invidious/views/delete_playlist.ecr @@ -1,20 +1,20 @@ <% content_for "header" do %> -<%= translate(locale, "Delete playlist") %> - Invidious +<%= I18n.translate(locale, "Delete playlist") %> - Invidious <% end %>
- <%= translate(locale, "Delete playlist `x`?", %|"#{HTML.escape(playlist.title)}"|) %> + <%= I18n.translate(locale, "Delete playlist `x`?", %|"#{HTML.escape(playlist.title)}"|) %>
diff --git a/src/invidious/views/edit_playlist.ecr b/src/invidious/views/edit_playlist.ecr index 34157c675..123a5d443 100644 --- a/src/invidious/views/edit_playlist.ecr +++ b/src/invidious/views/edit_playlist.ecr @@ -10,17 +10,17 @@ @@ -36,11 +36,11 @@
<%= HTML.escape(playlist.author) %> | - <%= translate_count(locale, "generic_videos_count", playlist.video_count) %> | + <%= I18n.translate_count(locale, "generic_videos_count", playlist.video_count) %> |
diff --git a/src/invidious/views/feeds/history.ecr b/src/invidious/views/feeds/history.ecr index 13fe41479..cfa5c7e19 100644 --- a/src/invidious/views/feeds/history.ecr +++ b/src/invidious/views/feeds/history.ecr @@ -1,19 +1,19 @@ <% content_for "header" do %> -<%= translate(locale, "History") %> - Invidious +<%= I18n.translate(locale, "History") %> - Invidious <% end %>
-

<%= translate_count(locale, "generic_videos_count", user.watched.size, NumberFormatting::HtmlSpan) %>

+

<%= I18n.translate_count(locale, "generic_videos_count", user.watched.size, I18n::NumberFormatting::HtmlSpan) %>

diff --git a/src/invidious/views/feeds/playlists.ecr b/src/invidious/views/feeds/playlists.ecr index 2a4b6edda..baf64e974 100644 --- a/src/invidious/views/feeds/playlists.ecr +++ b/src/invidious/views/feeds/playlists.ecr @@ -1,22 +1,22 @@ <% content_for "header" do %> -<%= translate(locale, "Playlists") %> - Invidious +<%= I18n.translate(locale, "Playlists") %> - Invidious <% end %> <%= rendered "components/feed_menu" %>
-

<%= translate(locale, "user_created_playlists", %(#{items_created.size})) %>

+

<%= I18n.translate(locale, "user_created_playlists", %(#{items_created.size})) %>

@@ -30,7 +30,7 @@
-

<%= translate(locale, "user_saved_playlists", %(#{items_saved.size})) %>

+

<%= I18n.translate(locale, "user_saved_playlists", %(#{items_saved.size})) %>

diff --git a/src/invidious/views/feeds/popular.ecr b/src/invidious/views/feeds/popular.ecr index 5fbe539c9..4177e53d6 100644 --- a/src/invidious/views/feeds/popular.ecr +++ b/src/invidious/views/feeds/popular.ecr @@ -1,8 +1,8 @@ <% content_for "header" do %> -"> +"> <% if env.get("preferences").as(Preferences).default_home != "Popular" %> - <%= translate(locale, "Popular") %> - Invidious + <%= I18n.translate(locale, "Popular") %> - Invidious <% else %> Invidious <% end %> diff --git a/src/invidious/views/feeds/subscriptions.ecr b/src/invidious/views/feeds/subscriptions.ecr index c36bd00fd..57e205260 100644 --- a/src/invidious/views/feeds/subscriptions.ecr +++ b/src/invidious/views/feeds/subscriptions.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<title><%= translate(locale, "Subscriptions") %> - Invidious +<%= I18n.translate(locale, "Subscriptions") %> - Invidious <% end %> @@ -8,12 +8,12 @@
@@ -26,7 +26,7 @@ <% if CONFIG.enable_user_notifications %>
- <%= translate_count(locale, "subscriptions_unseen_notifs_count", notifications.size) %> + <%= I18n.translate_count(locale, "subscriptions_unseen_notifs_count", notifications.size) %>
<% if !notifications.empty? %> diff --git a/src/invidious/views/feeds/trending.ecr b/src/invidious/views/feeds/trending.ecr index 46d02ad4f..8cf3d1c66 100644 --- a/src/invidious/views/feeds/trending.ecr +++ b/src/invidious/views/feeds/trending.ecr @@ -1,8 +1,8 @@ <% content_for "header" do %> -"> +"> <% if env.get("preferences").as(Preferences).default_home != "Trending" %> - <%= translate(locale, "Trending") %> - Invidious + <%= I18n.translate(locale, "Trending") %> - Invidious <% else %> Invidious <% end %> @@ -15,7 +15,7 @@ <div style="align-self:flex-end" class="pure-u-2-3"> <% if plid %> <a href="/playlist?list=<%= plid %>"> - <%= translate(locale, "View as playlist") %> + <%= I18n.translate(locale, "View as playlist") %> </a> <% end %> </div> @@ -24,10 +24,10 @@ <% {"Livestreams", "Gaming"}.each do |option| %> <div class="pure-u-1 pure-md-1-3"> <% if trending_type == option %> - <b><%= translate(locale, option) %></b> + <b><%= I18n.translate(locale, option) %></b> <% else %> <a href="/feed/trending?type=<%= option %>®ion=<%= region %>"> - <%= translate(locale, option) %> + <%= I18n.translate(locale, option) %> </a> <% end %> </div> diff --git a/src/invidious/views/licenses.ecr b/src/invidious/views/licenses.ecr index 3037f3d7a..0776b0d7d 100644 --- a/src/invidious/views/licenses.ecr +++ b/src/invidious/views/licenses.ecr @@ -7,7 +7,7 @@ </head> <body> - <h1><%= translate(locale, "JavaScript license information") %></h1> + <h1><%= I18n.translate(locale, "JavaScript license information") %></h1> <table id="jslicense-labels1"> <tr> <td> @@ -19,7 +19,7 @@ </td> <td> - <a href="https://github.com/iv-org/videojs-quality-selector"><%= translate(locale, "source") %></a> + <a href="https://github.com/iv-org/videojs-quality-selector"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -33,7 +33,7 @@ </td> <td> - <a href="https://github.com/mpetazzoni/sse.js"><%= translate(locale, "source") %></a> + <a href="https://github.com/mpetazzoni/sse.js"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -47,7 +47,7 @@ </td> <td> - <a href="https://github.com/videojs/videojs-contrib-quality-levels"><%= translate(locale, "source") %></a> + <a href="https://github.com/videojs/videojs-contrib-quality-levels"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -61,7 +61,7 @@ </td> <td> - <a href="https://github.com/jfujita/videojs-http-source-selector"><%= translate(locale, "source") %></a> + <a href="https://github.com/jfujita/videojs-http-source-selector"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -75,7 +75,7 @@ </td> <td> - <a href="https://github.com/mister-ben/videojs-mobile-ui"><%= translate(locale, "source") %></a> + <a href="https://github.com/mister-ben/videojs-mobile-ui"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -89,7 +89,7 @@ </td> <td> - <a href="https://github.com/spchuang/videojs-markers"><%= translate(locale, "source") %></a> + <a href="https://github.com/spchuang/videojs-markers"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -103,7 +103,7 @@ </td> <td> - <a href="https://github.com/brightcove/videojs-overlay"><%= translate(locale, "source") %></a> + <a href="https://github.com/brightcove/videojs-overlay"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -117,7 +117,7 @@ </td> <td> - <a href="https://github.com/mkhazov/videojs-share"><%= translate(locale, "source") %></a> + <a href="https://github.com/mkhazov/videojs-share"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -131,7 +131,7 @@ </td> <td> - <a href="https://github.com/chrisboustead/videojs-vtt-thumbnails"><%= translate(locale, "source") %></a> + <a href="https://github.com/chrisboustead/videojs-vtt-thumbnails"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -145,7 +145,7 @@ </td> <td> - <a href="https://github.com/afrmtbl/videojs-youtube-annotations"><%= translate(locale, "source") %></a> + <a href="https://github.com/afrmtbl/videojs-youtube-annotations"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -159,7 +159,7 @@ </td> <td> - <a href="https://github.com/videojs/videojs-vr"><%= translate(locale, "source") %></a> + <a href="https://github.com/videojs/videojs-vr"><%= I18n.translate(locale, "source") %></a> </td> </tr> @@ -173,7 +173,7 @@ </td> <td> - <a href="https://github.com/videojs/video.js"><%= translate(locale, "source") %></a> + <a href="https://github.com/videojs/video.js"><%= I18n.translate(locale, "source") %></a> </td> </tr> diff --git a/src/invidious/views/message.ecr b/src/invidious/views/message.ecr index 8c7bf6113..789846faa 100644 --- a/src/invidious/views/message.ecr +++ b/src/invidious/views/message.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<meta name="description" content="<%= translate(locale, "An alternative front-end to YouTube") %>"> +<meta name="description" content="<%= I18n.translate(locale, "An alternative front-end to YouTube") %>"> <title> Invidious diff --git a/src/invidious/views/playlist.ecr b/src/invidious/views/playlist.ecr index c27ddba60..e41662c8f 100644 --- a/src/invidious/views/playlist.ecr +++ b/src/invidious/views/playlist.ecr @@ -13,28 +13,28 @@ <%- if playlist.is_a?(InvidiousPlaylist) && playlist.author == user.try &.email -%> <%- else -%> @@ -42,7 +42,7 @@
@@ -57,15 +57,15 @@ <% else %> <%= author %> | <% end %> - <%= translate_count(locale, "generic_videos_count", playlist.video_count) %> | - <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> | + <%= I18n.translate_count(locale, "generic_videos_count", playlist.video_count) %> | + <%= I18n.translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> | <% case playlist.as(InvidiousPlaylist).privacy when %> <% when PlaylistPrivacy::Public %> - <%= translate(locale, "Public") %> + <%= I18n.translate(locale, "Public") %> <% when PlaylistPrivacy::Unlisted %> - <%= translate(locale, "Unlisted") %> + <%= I18n.translate(locale, "Unlisted") %> <% when PlaylistPrivacy::Private %> - <%= translate(locale, "Private") %> + <%= I18n.translate(locale, "Private") %> <% end %> <% else %> @@ -76,25 +76,25 @@ <% subtitle = playlist.subtitle || "" %> <%= HTML.escape(subtitle[0..subtitle.rindex(" • ") || subtitle.size]) %> | <% end %> - <%= translate_count(locale, "generic_videos_count", playlist.video_count) %> | - <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> + <%= I18n.translate_count(locale, "generic_videos_count", playlist.video_count) %> | + <%= I18n.translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> <% end %> <% if !playlist.is_a? InvidiousPlaylist %> diff --git a/src/invidious/views/post.ecr b/src/invidious/views/post.ecr index f644d634c..c6ce57973 100644 --- a/src/invidious/views/post.ecr +++ b/src/invidious/views/post.ecr @@ -18,7 +18,7 @@ <% else %> <% end %> @@ -29,12 +29,12 @@ <%= { "id" => id, - "youtube_comments_text" => HTML.escape(translate(locale, "View YouTube comments")), + "youtube_comments_text" => HTML.escape(I18n.translate(locale, "View YouTube comments")), "reddit_comments_text" => "", "reddit_permalink_text" => "", - "comments_text" => HTML.escape(translate(locale, "View `x` comments", "{commentCount}")), - "hide_replies_text" => HTML.escape(translate(locale, "Hide replies")), - "show_replies_text" => HTML.escape(translate(locale, "Show replies")), + "comments_text" => HTML.escape(I18n.translate(locale, "View `x` comments", "{commentCount}")), + "hide_replies_text" => HTML.escape(I18n.translate(locale, "Hide replies")), + "show_replies_text" => HTML.escape(I18n.translate(locale, "Show replies")), "params" => { "comments": ["youtube"] }, @@ -45,4 +45,4 @@ %> - \ No newline at end of file + diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index b13002140..2ffe27a16 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -11,9 +11,9 @@ <%- if items.empty? -%>
- <%= translate(locale, "search_message_no_results") %>

- <%= translate(locale, "search_message_change_filters_or_query") %>

- <%= translate(locale, "search_message_use_another_instance", redirect_url) %> + <%= I18n.translate(locale, "search_message_no_results") %>

+ <%= I18n.translate(locale, "search_message_change_filters_or_query") %>

+ <%= I18n.translate(locale, "search_message_use_another_instance", redirect_url) %>
<%- else -%> diff --git a/src/invidious/views/search_homepage.ecr b/src/invidious/views/search_homepage.ecr index 2424a1cf7..911526d14 100644 --- a/src/invidious/views/search_homepage.ecr +++ b/src/invidious/views/search_homepage.ecr @@ -1,7 +1,7 @@ <% content_for "header" do %> -"> +"> - Invidious - <%= translate(locale, "search") %> + Invidious - <%= I18n.translate(locale, "search") %> <% end %> diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 40f5544fe..82d15958e 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -43,7 +43,7 @@ <% else %> <% if CONFIG.login_enabled %> <% end %> @@ -119,39 +119,39 @@ <% if CONFIG.modified_source_code_url %> - <%= translate(locale, "footer_original_source_code") %> / - <%= translate(locale, "footer_modfied_source_code") %> + <%= I18n.translate(locale, "footer_original_source_code") %> / + <%= I18n.translate(locale, "footer_modfied_source_code") %> <% else %> - <%= translate(locale, "footer_source_code") %> + <%= I18n.translate(locale, "footer_source_code") %> <% end %> - <%= translate(locale, "footer_documentation") %> + <%= I18n.translate(locale, "footer_documentation") %>
- <%= translate(locale, "footer_donate_page") %> + <%= I18n.translate(locale, "footer_donate_page") %> - <%= translate(locale, "Current version: ") %> + <%= I18n.translate(locale, "Current version: ") %> <% if CONFIG.modified_source_code_url %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> <% else %> @@ -181,8 +181,8 @@ diff --git a/src/invidious/views/user/authorize_token.ecr b/src/invidious/views/user/authorize_token.ecr index 725f392ed..581fc1d56 100644 --- a/src/invidious/views/user/authorize_token.ecr +++ b/src/invidious/views/user/authorize_token.ecr @@ -1,22 +1,22 @@ <% content_for "header" do %> -<%= translate(locale, "Token") %> - Invidious +<%= I18n.translate(locale, "Token") %> - Invidious <% end %> <% if env.get? "access_token" %> @@ -30,9 +30,9 @@
<% if callback_url %> - <%= translate(locale, "Authorize token for `x`?", "#{callback_url.scheme}://#{callback_url.host}") %> + <%= I18n.translate(locale, "Authorize token for `x`?", "#{callback_url.scheme}://#{callback_url.host}") %> <% else %> - <%= translate(locale, "Authorize token?") %> + <%= I18n.translate(locale, "Authorize token?") %> <% end %>
@@ -48,7 +48,7 @@
diff --git a/src/invidious/views/user/change_password.ecr b/src/invidious/views/user/change_password.ecr index 1b9eb82e1..e22891d69 100644 --- a/src/invidious/views/user/change_password.ecr +++ b/src/invidious/views/user/change_password.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Change password") %> - Invidious +<%= I18n.translate(locale, "Change password") %> - Invidious <% end %>
@@ -7,20 +7,20 @@
- <%= translate(locale, "Change password") %> + <%= I18n.translate(locale, "Change password") %>
- - "> + + "> - - "> + + "> - - "> + + "> diff --git a/src/invidious/views/user/clear_watch_history.ecr b/src/invidious/views/user/clear_watch_history.ecr index c9acbe448..a50b113a2 100644 --- a/src/invidious/views/user/clear_watch_history.ecr +++ b/src/invidious/views/user/clear_watch_history.ecr @@ -1,20 +1,20 @@ <% content_for "header" do %> -<%= translate(locale, "Clear watch history") %> - Invidious +<%= I18n.translate(locale, "Clear watch history") %> - Invidious <% end %>
- <%= translate(locale, "Clear watch history?") %> + <%= I18n.translate(locale, "Clear watch history?") %>
diff --git a/src/invidious/views/user/data_control.ecr b/src/invidious/views/user/data_control.ecr index e57926f50..1ada97122 100644 --- a/src/invidious/views/user/data_control.ecr +++ b/src/invidious/views/user/data_control.ecr @@ -1,67 +1,67 @@ <% content_for "header" do %> -<%= translate(locale, "Import and Export Data") %> - Invidious +<%= I18n.translate(locale, "Import and Export Data") %> - Invidious <% end %>
- <%= translate(locale, "Import") %> + <%= I18n.translate(locale, "Import") %>
- +
- +
- +
- +
- +
- +
- +
- <%= translate(locale, "Export") %> + <%= I18n.translate(locale, "Export") %>
diff --git a/src/invidious/views/user/delete_account.ecr b/src/invidious/views/user/delete_account.ecr index 67351bbf4..dfc852fb6 100644 --- a/src/invidious/views/user/delete_account.ecr +++ b/src/invidious/views/user/delete_account.ecr @@ -1,20 +1,20 @@ <% content_for "header" do %> -<%= translate(locale, "Delete account") %> - Invidious +<%= I18n.translate(locale, "Delete account") %> - Invidious <% end %>
- <%= translate(locale, "Delete account?") %> + <%= I18n.translate(locale, "Delete account?") %>
diff --git a/src/invidious/views/user/login.ecr b/src/invidious/views/user/login.ecr index 7ac96bc6f..4324133ae 100644 --- a/src/invidious/views/user/login.ecr +++ b/src/invidious/views/user/login.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= translate(locale, "Log in") %> - Invidious +<%= I18n.translate(locale, "Log in") %> - Invidious <% end %>
@@ -13,15 +13,15 @@ <% if email %> <% else %> - - "> + + "> <% end %> <% if password %> <% else %> - - "> + + "> <% end %> <% if captcha %> @@ -30,15 +30,15 @@ <% captcha[:tokens].each_with_index do |token, i| %> <% end %> - + <% else %> <% end %>
diff --git a/src/invidious/views/user/preferences.ecr b/src/invidious/views/user/preferences.ecr index 23cb89f69..703423c04 100644 --- a/src/invidious/views/user/preferences.ecr +++ b/src/invidious/views/user/preferences.ecr @@ -1,49 +1,49 @@ <% content_for "header" do %> -<%= translate(locale, "Preferences") %> - Invidious +<%= I18n.translate(locale, "Preferences") %> - Invidious <% end %>
- <%= translate(locale, "preferences_category_player") %> + <%= I18n.translate(locale, "preferences_category_player") %>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>>
- + checked<% end %>>
- + <% {"dash", "hd720", "medium", "small"}.each do |option| %> <% if !(option == "dash" && CONFIG.disabled?("dash")) %> - + <% end %> <% end %> @@ -64,74 +64,74 @@ <% if !CONFIG.disabled?("dash") %>
- +
<% end %>
- + <%= preferences.volume %>
- + <% preferences.comments.each_with_index do |comments, index| %> <% end %>
- + <% preferences.captions.each_with_index do |caption, index| %> <% end %>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
<% if user = env.get?("user").try &.as(User) %> <% playlists = Invidious::Database::Playlists.select_user_created_playlists(user.email) %>
- + - <% LOCALES_LIST.each do |iso_name, full_name| %> + <% I18n::LOCALES_LIST.each do |iso_name, full_name| %> <% end %>
- +
- +
- +
- + checked<% end %>>
@@ -189,187 +189,187 @@ <% end %>
- +
- + <% (feed_options.size - 1).times do |index| %> <% end %>
<% if env.get? "user" %>
- + checked<% end %>>
<% end %> - <%= translate(locale, "preferences_category_misc") %> + <%= I18n.translate(locale, "preferences_category_misc") %>
- + checked<% end %>>
<% if env.get? "user" %> - <%= translate(locale, "preferences_category_subscription") %> + <%= I18n.translate(locale, "preferences_category_subscription") %>
- + checked<% end %>>
- + checked<% end %>>
- +
- +
<% if preferences.unseen_only %> - + <% else %> - + <% end %> checked<% end %>>
- + checked<% end %>>
<% if CONFIG.enable_user_notifications %>
- + checked<% end %>>
<% # Web notifications are only supported over HTTPS %> <% if Kemal.config.ssl || CONFIG.https_only %> <% end %> <% end %> <% end %> <% if env.get?("user") && CONFIG.admins.includes? env.get?("user").as(Invidious::User).email %> - <%= translate(locale, "preferences_category_admin") %> + <%= I18n.translate(locale, "preferences_category_admin") %>
- +
- + <% (feed_options.size - 1).times do |index| %> <% end %>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- + checked<% end %>>
- +
<% end %> <% if env.get? "user" %> - <%= translate(locale, "preferences_category_data") %> + <%= I18n.translate(locale, "preferences_category_data") %> <% end %>
- +
diff --git a/src/invidious/views/user/subscription_manager.ecr b/src/invidious/views/user/subscription_manager.ecr index d566e2285..4da2e9fbb 100644 --- a/src/invidious/views/user/subscription_manager.ecr +++ b/src/invidious/views/user/subscription_manager.ecr @@ -1,26 +1,26 @@ <% content_for "header" do %> -<%= translate(locale, "Subscription manager") %> - Invidious +<%= I18n.translate(locale, "Subscription manager") %> - Invidious <% end %> diff --git a/src/invidious/views/user/token_manager.ecr b/src/invidious/views/user/token_manager.ecr index 8431deb04..85be838ac 100644 --- a/src/invidious/views/user/token_manager.ecr +++ b/src/invidious/views/user/token_manager.ecr @@ -1,17 +1,17 @@ <% content_for "header" do %> -<%= translate(locale, "Token manager") %> - Invidious +<%= I18n.translate(locale, "Token manager") %> - Invidious <% end %>

- <%= translate_count(locale, "tokens_count", tokens.size, NumberFormatting::HtmlSpan) %> + <%= I18n.translate_count(locale, "tokens_count", tokens.size, I18n::NumberFormatting::HtmlSpan) %>

@@ -25,13 +25,13 @@
-

<%= translate(locale, "`x` ago", recode_date(token[:issued], locale)) %>

+

<%= I18n.translate(locale, "`x` ago", recode_date(token[:issued], locale)) %>

" method="post"> "> - "> + ">

diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 11ab96d6e..8fca69840 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -35,11 +35,11 @@ we're going to need to do it here in order to allow for translations. --> <% end %> @@ -53,12 +53,12 @@ we're going to need to do it here in order to allow for translations. "length_seconds" => video.length_seconds.to_f, "play_next" => !video.related_videos.empty? && !plid && params.continue, "next_video" => video.related_videos.select { |rv| rv["id"]? }[0]?.try &.["id"], - "youtube_comments_text" => HTML.escape(translate(locale, "View YouTube comments")), - "reddit_comments_text" => HTML.escape(translate(locale, "View Reddit comments")), - "reddit_permalink_text" => HTML.escape(translate(locale, "View more comments on Reddit")), - "comments_text" => HTML.escape(translate(locale, "View `x` comments", "{commentCount}")), - "hide_replies_text" => HTML.escape(translate(locale, "Hide replies")), - "show_replies_text" => HTML.escape(translate(locale, "Show replies")), + "youtube_comments_text" => HTML.escape(I18n.translate(locale, "View YouTube comments")), + "reddit_comments_text" => HTML.escape(I18n.translate(locale, "View Reddit comments")), + "reddit_permalink_text" => HTML.escape(I18n.translate(locale, "View more comments on Reddit")), + "comments_text" => HTML.escape(I18n.translate(locale, "View `x` comments", "{commentCount}")), + "hide_replies_text" => HTML.escape(I18n.translate(locale, "Hide replies")), + "show_replies_text" => HTML.escape(I18n.translate(locale, "Show replies")), "params" => params, "preferences" => preferences, "premiere_timestamp" => video.premiere_timestamp.try &.to_unix, @@ -79,11 +79,11 @@ we're going to need to do it here in order to allow for translations.

<%= title %> <% if params.listen %> - " id="link-iv-listen" data-base-url="/watch?<%= env.params.query %>&listen=0" href="/watch?<%= env.params.query %>&listen=0"> + " id="link-iv-listen" data-base-url="/watch?<%= env.params.query %>&listen=0" href="/watch?<%= env.params.query %>&listen=0"> <% else %> - " id="link-iv-listen" data-base-url="/watch?<%= env.params.query %>&listen=1" href="/watch?<%= env.params.query %>&listen=1"> + " id="link-iv-listen" data-base-url="/watch?<%= env.params.query %>&listen=1" href="/watch?<%= env.params.query %>&listen=1"> <% end %> @@ -91,7 +91,7 @@ we're going to need to do it here in order to allow for translations. <% if !video.is_listed %>

- <%= translate(locale, "Unlisted") %> + <%= I18n.translate(locale, "Unlisted") %>

<% end %> @@ -101,11 +101,11 @@ we're going to need to do it here in order to allow for translations. <% elsif video.premiere_timestamp.try &.> Time.utc %>

- <%= video.premiere_timestamp.try { |t| translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %> + <%= video.premiere_timestamp.try { |t| I18n.translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %>

<% elsif video.live_now %>

- <%= video.premiere_timestamp.try { |t| translate(locale, "videoinfo_started_streaming_x_ago", recode_date((Time.utc - t).ago, locale)) } %> + <%= video.premiere_timestamp.try { |t| I18n.translate(locale, "videoinfo_started_streaming_x_ago", recode_date((Time.utc - t).ago, locale)) } %>

<% end %>
@@ -124,13 +124,13 @@ we're going to need to do it here in order to allow for translations. link_yt_embed = IV::HttpServer::Utils.add_params_to_url(link_yt_embed, link_yt_param) end -%> - <%= translate(locale, "videoinfo_watch_on_youTube") %> - (<%= translate(locale, "videoinfo_youTube_embed_link") %>) + <%= I18n.translate(locale, "videoinfo_watch_on_youTube") %> + (<%= I18n.translate(locale, "videoinfo_youTube_embed_link") %>)

<%- link_iv_other = IV::Frontend::Misc.redirect_url(env) -%> - <%= translate(locale, "Switch Invidious Instance") %> + <%= I18n.translate(locale, "Switch Invidious Instance") %>

<% if params.annotations %> - <%= translate(locale, "Hide annotations") %> + <%= I18n.translate(locale, "Hide annotations") %> <% else %> - <%=translate(locale, "Show annotations")%> + <%=I18n.translate(locale, "Show annotations")%> <% end %>

@@ -161,7 +161,7 @@ we're going to need to do it here in order to allow for translations. <% if !playlists.empty? %>
- + ">