diff --git a/scripts/generate_js_licenses.cr b/scripts/generate_js_licenses.cr index 7df70bf2a..1f4ffa624 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} - \#{I18n.translate(locale, "source")} + \#{translate(locale, "source")} " HTML diff --git a/spec/invidious/hashtag_spec.cr b/spec/invidious/hashtag_spec.cr index 473987190..abc81225c 100644 --- a/spec/invidious/hashtag_spec.cr +++ b/spec/invidious/hashtag_spec.cr @@ -4,7 +4,7 @@ Spectator.describe Invidious::Hashtag do it "parses richItemRenderer containers (test 1)" do # Enable mock test_content = load_mock("hashtag/martingarrix_page1") - videos, _ = YoutubeJSONParser.extract_items(test_content) + videos, _ = extract_items(test_content) expect(typeof(videos)).to eq(Array(SearchItem)) expect(videos.size).to eq(60) @@ -57,7 +57,7 @@ Spectator.describe Invidious::Hashtag do it "parses richItemRenderer containers (test 2)" do # Enable mock test_content = load_mock("hashtag/martingarrix_page2") - videos, _ = YoutubeJSONParser.extract_items(test_content) + videos, _ = extract_items(test_content) expect(typeof(videos)).to eq(Array(SearchItem)) expect(videos.size).to eq(60) diff --git a/spec/invidious/videos/regular_videos_extract_spec.cr b/spec/invidious/videos/regular_videos_extract_spec.cr index 0a29161e4..f96703f66 100644 --- a/spec/invidious/videos/regular_videos_extract_spec.cr +++ b/spec/invidious/videos/regular_videos_extract_spec.cr @@ -7,7 +7,7 @@ Spectator.describe "parse_video_info" do _next = load_mock("video/regular_mrbeast.next") raw_data = _player.merge!(_next) - info = Parser.parse_video_info("2isYuQZMbdU", raw_data) + info = parse_video_info("2isYuQZMbdU", raw_data) # Some basic verifications expect(typeof(info)).to eq(Hash(String, JSON::Any)) @@ -89,7 +89,7 @@ Spectator.describe "parse_video_info" do _next = load_mock("video/regular_no-description.next") raw_data = _player.merge!(_next) - info = Parser.parse_video_info("iuevw6218F0", raw_data) + info = parse_video_info("iuevw6218F0", raw_data) # Some basic verifications expect(typeof(info)).to eq(Hash(String, JSON::Any)) diff --git a/spec/invidious/videos/scheduled_live_extract_spec.cr b/spec/invidious/videos/scheduled_live_extract_spec.cr index 6e686baf7..c3a9b2285 100644 --- a/spec/invidious/videos/scheduled_live_extract_spec.cr +++ b/spec/invidious/videos/scheduled_live_extract_spec.cr @@ -7,7 +7,7 @@ Spectator.describe "parse_video_info" do _next = load_mock("video/scheduled_live_PBD-Podcast.next") raw_data = _player.merge!(_next) - info = Parser.parse_video_info("N-yVic7BbY0", raw_data) + info = parse_video_info("N-yVic7BbY0", raw_data) # Some basic verifications expect(typeof(info)).to eq(Hash(String, JSON::Any)) diff --git a/src/invidious/channels/about.cr b/src/invidious/channels/about.cr index fa99e99f1..139095279 100644 --- a/src/invidious/channels/about.cr +++ b/src/invidious/channels/about.cr @@ -200,7 +200,7 @@ def fetch_related_channels(about_channel : AboutChannel, continuation : String? initial_data = YoutubeAPI.browse(continuation) end - items, continuation = YoutubeJSONParser.extract_items(initial_data) + items, continuation = extract_items(initial_data) return items.select(SearchChannel), continuation end diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index e10e44895..81f664b78 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", I18n.translate(locale, "`x` ago", recode_date(self.published, locale)) + json.field "publishedText", translate(locale, "`x` ago", recode_date(self.published, locale)) json.field "viewCount", self.views end @@ -156,8 +156,8 @@ def get_channel(id) : InvidiousChannel end def fetch_channel(ucid, pull_all_videos : Bool) - ::Log.forf.debug { "#{ucid}" } - ::Log.forf.trace { "#{ucid} : pull_all_videos = #{pull_all_videos}" } + Log.debug { "fetch_channel: #{ucid}" } + Log.trace { "fetch_channel: #{ucid} : pull_all_videos = #{pull_all_videos}" } namespaces = { "yt" => "http://www.youtube.com/xml/schemas/2015", @@ -165,9 +165,9 @@ def fetch_channel(ucid, pull_all_videos : Bool) "default" => "http://www.w3.org/2005/Atom", } - ::Log.forf.trace { "#{ucid} : Downloading RSS feed" } + Log.trace { "fetch_channel: #{ucid} : Downloading RSS feed" } rss = YT_POOL.client &.get("/feeds/videos.xml?channel_id=#{ucid}").body - ::Log.forf.trace { "#{ucid} : Parsing RSS feed" } + Log.trace { "fetch_channel: #{ucid} : Parsing RSS feed" } rss = XML.parse(rss) author = rss.xpath_node("//default:feed/default:title", namespaces) @@ -184,7 +184,7 @@ def fetch_channel(ucid, pull_all_videos : Bool) auto_generated = true end - ::Log.forf.trace { "#{ucid} : author = #{author}, auto_generated = #{auto_generated}" } + Log.trace { "fetch_channel: #{ucid} : author = #{author}, auto_generated = #{auto_generated}" } channel = InvidiousChannel.new({ id: ucid, @@ -194,10 +194,10 @@ def fetch_channel(ucid, pull_all_videos : Bool) subscribed: nil, }) - ::Log.forf.trace { "#{ucid} : Downloading channel videos page" } + Log.trace { "fetch_channel: #{ucid} : Downloading channel videos page" } videos, continuation = IV::Channel::Tabs.get_videos(channel) - ::Log.forf.trace { "#{ucid} : Extracting videos from channel RSS feed" } + Log.trace { "fetch_channel: #{ucid} : Extracting videos from channel RSS feed" } rss.xpath_nodes("//default:feed/default:entry", namespaces).each do |entry| video_id = entry.xpath_node("yt:videoId", namespaces).not_nil!.content title = entry.xpath_node("default:title", namespaces).not_nil!.content @@ -241,17 +241,17 @@ def fetch_channel(ucid, pull_all_videos : Bool) views: views, }) - ::Log.forf.trace { "#{ucid} : video #{video_id} : Updating or inserting video" } + Log.trace { "fetch_channel: #{ucid} : video #{video_id} : Updating or inserting video" } # We don't include the 'premiere_timestamp' here because channel pages don't include them, # meaning the above timestamp is always null was_insert = Invidious::Database::ChannelVideos.insert(video) if was_insert - ::Log.forf.trace { "#{ucid} : video #{video_id} : Inserted, updating subscriptions" } + Log.trace { "fetch_channel: #{ucid} : video #{video_id} : Inserted, updating subscriptions" } NOTIFICATION_CHANNEL.send(VideoNotification.from_video(video)) else - ::Log.forf.trace { "#{ucid} : video #{video_id} : Updated" } + Log.trace { "fetch_channel: #{ucid} : video #{video_id} : Updated" } end end diff --git a/src/invidious/channels/community.cr b/src/invidious/channels/community.cr index 063beb421..43843b119 100644 --- a/src/invidious/channels/community.cr +++ b/src/invidious/channels/community.cr @@ -7,7 +7,7 @@ def fetch_channel_community(ucid, cursor, locale, format, thin_mode) initial_data = YoutubeAPI.browse(ucid, params: "EgVwb3N0c_IGBAoCSgA%3D") items = [] of JSON::Any - YoutubeJSONParser.extract_items(initial_data) do |item| + extract_items(initial_data) do |item| items << item end else @@ -49,7 +49,7 @@ def fetch_channel_community_post(ucid, post_id, locale, format, thin_mode) initial_data = YoutubeAPI.browse("FEpost_detail", params: params) items = [] of JSON::Any - YoutubeJSONParser.extract_items(initial_data) do |item| + extract_items(initial_data) do |item| items << item end @@ -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", I18n.translate(locale, "`x` ago", recode_date(published, locale)) + json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale)) json.field "likeCount", like_count json.field "replyCount", reply_count @@ -142,7 +142,7 @@ def extract_channel_community(items, *, ucid, locale, format, thin_mode, is_sing json.field "attachment" do case attachment.as_h when .has_key?("videoRenderer") - YoutubeJSONParser.parse_item(attachment) + parse_item(attachment) .as(SearchVideo) .to_json(locale, json) when .has_key?("backstageImageRenderer") @@ -230,7 +230,7 @@ def extract_channel_community(items, *, ucid, locale, format, thin_mode, is_sing end end when .has_key?("playlistRenderer") - YoutubeJSONParser.parse_item(attachment) + parse_item(attachment) .as(SearchPlaylist) .to_json(locale, json) when .has_key?("quizRenderer") diff --git a/src/invidious/channels/playlists.cr b/src/invidious/channels/playlists.cr index f99634043..cba1abd9c 100644 --- a/src/invidious/channels/playlists.cr +++ b/src/invidious/channels/playlists.cr @@ -24,7 +24,7 @@ def fetch_channel_playlists(ucid, author, continuation, sort_by) initial_data = YoutubeAPI.browse(ucid, params: params || "") end - return YoutubeJSONParser.extract_items(initial_data, author, ucid) + return extract_items(initial_data, author, ucid) end def fetch_channel_podcasts(ucid, author, continuation) @@ -33,7 +33,7 @@ def fetch_channel_podcasts(ucid, author, continuation) else initial_data = YoutubeAPI.browse(ucid, params: "Eghwb2RjYXN0c_IGBQoDugEA") end - return YoutubeJSONParser.extract_items(initial_data, author, ucid) + return extract_items(initial_data, author, ucid) end def fetch_channel_releases(ucid, author, continuation) @@ -42,7 +42,7 @@ def fetch_channel_releases(ucid, author, continuation) else initial_data = YoutubeAPI.browse(ucid, params: "EghyZWxlYXNlc_IGBQoDsgEA") end - return YoutubeJSONParser.extract_items(initial_data, author, ucid) + return extract_items(initial_data, author, ucid) end def fetch_channel_courses(ucid, author, continuation) @@ -51,5 +51,5 @@ def fetch_channel_courses(ucid, author, continuation) else initial_data = YoutubeAPI.browse(ucid, params: "Egdjb3Vyc2Vz8gYFCgPCAQA%3D") end - return YoutubeJSONParser.extract_items(initial_data, author, ucid) + return extract_items(initial_data, author, ucid) end diff --git a/src/invidious/channels/videos.cr b/src/invidious/channels/videos.cr index 919080546..96400f471 100644 --- a/src/invidious/channels/videos.cr +++ b/src/invidious/channels/videos.cr @@ -29,7 +29,7 @@ module Invidious::Channel::Tabs continuation ||= make_initial_videos_ctoken(ucid, sort_by) initial_data = YoutubeAPI.browse(continuation: continuation) - return YoutubeJSONParser.extract_items(initial_data, author, ucid) + return extract_items(initial_data, author, ucid) end def get_60_videos(channel : AboutChannel, *, continuation : String? = nil, sort_by = "newest") @@ -59,7 +59,7 @@ module Invidious::Channel::Tabs continuation ||= make_initial_shorts_ctoken(channel.ucid, sort_by) initial_data = YoutubeAPI.browse(continuation: continuation) - return YoutubeJSONParser.extract_items(initial_data, channel.author, channel.ucid) + return extract_items(initial_data, channel.author, channel.ucid) end # ------------------- @@ -70,7 +70,7 @@ module Invidious::Channel::Tabs continuation ||= make_initial_livestreams_ctoken(channel.ucid, sort_by) initial_data = YoutubeAPI.browse(continuation: continuation) - return YoutubeJSONParser.extract_items(initial_data, channel.author, channel.ucid) + return extract_items(initial_data, channel.author, channel.ucid) end def get_60_livestreams(channel : AboutChannel, *, continuation : String? = nil, sort_by = "newest") diff --git a/src/invidious/comments/youtube.cr b/src/invidious/comments/youtube.cr index 8b7987982..e923b2f8d 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", I18n.translate(locale, "`x` ago", recode_date(published, locale)) + json.field "publishedText", translate(locale, "`x` ago", recode_date(published, locale)) end if node_replies && !response["commentRepliesContinuation"]? diff --git a/src/invidious/database/base.cr b/src/invidious/database/base.cr index cf73fc493..bd00cd68a 100644 --- a/src/invidious/database/base.cr +++ b/src/invidious/database/base.cr @@ -34,7 +34,7 @@ module Invidious::Database return # TODO if !PG_DB.query_one?("SELECT true FROM pg_type WHERE typname = $1", enum_name, as: Bool) - ::Log.forf.info { "CREATE TYPE #{enum_name}" } + Log.info { "check_enum: CREATE TYPE #{enum_name}" } PG_DB.using_connection do |conn| conn.as(PG::Connection).exec_all(File.read("config/sql/#{enum_name}.sql")) @@ -47,7 +47,7 @@ module Invidious::Database begin PG_DB.exec("SELECT * FROM #{table_name} LIMIT 0") rescue ex - ::Log.forf.info { "CREATE TABLE #{table_name}" } + Log.info { "check_table: CREATE TABLE #{table_name}" } PG_DB.using_connection do |conn| conn.as(PG::Connection).exec_all(File.read("config/sql/#{table_name}.sql")) @@ -67,7 +67,7 @@ module Invidious::Database if name != column_array[i]? if !column_array[i]? new_column = column_types.select(&.starts_with?(name))[0] - ::Log.forf.info { "ALTER TABLE #{table_name} ADD COLUMN #{new_column}" } + Log.info { "check_table: ALTER TABLE #{table_name} ADD COLUMN #{new_column}" } PG_DB.exec("ALTER TABLE #{table_name} ADD COLUMN #{new_column}") next end @@ -85,29 +85,29 @@ module Invidious::Database # There's a column we didn't expect if !new_column - ::Log.forf.info { "ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]}" } + Log.info { "check_table: ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]}" } PG_DB.exec("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE") column_array = get_column_array(PG_DB, table_name) next end - ::Log.forf.info { "ALTER TABLE #{table_name} ADD COLUMN #{new_column}" } + Log.info { "check_table: ALTER TABLE #{table_name} ADD COLUMN #{new_column}" } PG_DB.exec("ALTER TABLE #{table_name} ADD COLUMN #{new_column}") - ::Log.forf.info { "UPDATE #{table_name} SET #{column_array[i]}_new=#{column_array[i]}" } + Log.info { "check_table: UPDATE #{table_name} SET #{column_array[i]}_new=#{column_array[i]}" } PG_DB.exec("UPDATE #{table_name} SET #{column_array[i]}_new=#{column_array[i]}") - ::Log.forf.info { "ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE" } + Log.info { "check_table: ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE" } PG_DB.exec("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE") - ::Log.forf.info { "ALTER TABLE #{table_name} RENAME COLUMN #{column_array[i]}_new TO #{column_array[i]}" } + Log.info { "check_table: ALTER TABLE #{table_name} RENAME COLUMN #{column_array[i]}_new TO #{column_array[i]}" } PG_DB.exec("ALTER TABLE #{table_name} RENAME COLUMN #{column_array[i]}_new TO #{column_array[i]}") column_array = get_column_array(PG_DB, table_name) end else - ::Log.forf.info { "ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE" } + Log.info { "check_table: ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE" } PG_DB.exec("ALTER TABLE #{table_name} DROP COLUMN #{column_array[i]} CASCADE") end end @@ -117,7 +117,7 @@ module Invidious::Database column_array.each do |column| if !struct_array.includes? column - ::Log.forf.info { "ALTER TABLE #{table_name} DROP COLUMN #{column} CASCADE" } + Log.info { "check_table: ALTER TABLE #{table_name} DROP COLUMN #{column} CASCADE" } PG_DB.exec("ALTER TABLE #{table_name} DROP COLUMN #{column} CASCADE") end end diff --git a/src/invidious/frontend/channel_page.cr b/src/invidious/frontend/channel_page.cr index 4af3b4f54..4fe21b964 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 << I18n.translate(locale, "channel_tab_#{tab_name}_label") + str << 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 << I18n.translate(locale, "channel_tab_#{tab_name}_label") + str << 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 74d9d8d81..4dda683ef 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} - #{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")} + #{translate_count(locale, "comments_points_count", child.score, NumberFormatting::Separator)} + #{translate(locale, "`x` ago", recode_date(child.created_utc, locale))} + #{translate(locale, "permalink")}

#{body_html} diff --git a/src/invidious/frontend/comments_youtube.cr b/src/invidious/frontend/comments_youtube.cr index 89d3caeff..a0e1d783d 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 = I18n.translate_count(locale, + replies_count_text = translate_count(locale, "comments_view_x_replies", child["replies"]["replyCount"].as_i64 || 0, - I18n::NumberFormatting::Separator + 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 = I18n.translate_count(locale, + replies_count_text = translate_count(locale, "comments_view_x_replies", child["replyCount"].as_i64 || 0, - I18n::NumberFormatting::Separator + 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 5453faa7a..c0926164e 100644 --- a/src/invidious/frontend/watch_page.cr +++ b/src/invidious/frontend/watch_page.cr @@ -20,7 +20,7 @@ module Invidious::Frontend::WatchPage def download_widget(locale : String, video : Video, video_assets : VideoAssets) : String if CONFIG.disabled?("downloads") - return "

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

" + return "

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

" end url = "/download" @@ -45,7 +45,7 @@ module Invidious::Frontend::WatchPage str << "\t
\n" str << "\t\t\n" str << "\t\tvalue="<%= HTML.escape(query.text) %>"<% end %> - placeholder="<%= I18n.translate(locale, "Search for videos") %>"> + placeholder="<%= translate(locale, "Search for videos") %>"> diff --git a/src/invidious/views/community.ecr b/src/invidious/views/community.ecr index a0fc47f57..132e636ce 100644 --- a/src/invidious/views/community.ecr +++ b/src/invidious/views/community.ecr @@ -35,10 +35,10 @@ <%= { "ucid" => ucid, - "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")), + "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")), "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 1288ff584..f4164f31b 100644 --- a/src/invidious/views/components/channel_info.ecr +++ b/src/invidious/views/components/channel_info.ecr @@ -24,7 +24,7 @@
-  <%= I18n.translate(locale, "generic_button_rss") %> +  <%= translate(locale, "generic_button_rss") %>
@@ -37,10 +37,10 @@
<%= Invidious::Frontend::ChannelPage.generate_tabs_links(locale, channel, selected_tab) %> @@ -50,9 +50,9 @@ <% sort_options.each do |sort| %>
<% if sort_by == sort %> - <%= I18n.translate(locale, sort) %> + <%= translate(locale, sort) %> <% else %> - <%= I18n.translate(locale, sort) %> + <%= translate(locale, sort) %> <% end %>
<% end %> diff --git a/src/invidious/views/components/feed_menu.ecr b/src/invidious/views/components/feed_menu.ecr index aeaf183b7..3dbeaf371 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| %> - <%= I18n.translate(locale, feed) %> + <%= translate(locale, feed) %> <% end %>
diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index ece2efe8a..a24423df9 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 %> -

<%= 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 %> +

<%= 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 %>
<%= item.description_html %>
<% when SearchHashtag %> <% if !thin_mode %> @@ -45,13 +45,13 @@
<%- if item.video_count != 0 -%> -

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

+

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

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

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

+

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

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

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

+

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

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

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

-

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

+

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

+

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

- <%=I18n.translate(locale, "timeline_parse_error_show_technical_details")%> + <%=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 -%> -

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

+

 <%= 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 %> -

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

+

<%= 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 %> -

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

+

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

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

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

+

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

<% end %>
diff --git a/src/invidious/views/components/items_paginated.ecr b/src/invidious/views/components/items_paginated.ecr index bb630d621..f69df3fe0 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 f957c25cd..29da2c523 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="<%= I18n.translate(locale, "search") %>" - title="<%= I18n.translate(locale, "search") %>" + name="q" placeholder="<%= translate(locale, "search") %>" + title="<%= 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 742e9a82a..3cfcb0ebd 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(I18n.translate(locale, "Subscribe")), - "unsubscribe_text" => HTML.escape(I18n.translate(locale, "Unsubscribe")) + "subscribe_text" => HTML.escape(translate(locale, "Subscribe")), + "unsubscribe_text" => HTML.escape(translate(locale, "Unsubscribe")) }.to_pretty_json %> @@ -31,6 +31,6 @@ <% else %> "> - <%= I18n.translate(locale, "Subscribe") %> | <%= sub_count_text %> + <%= 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 c9aff4724..22458a030 100644 --- a/src/invidious/views/components/video-context-buttons.ecr +++ b/src/invidious/views/components/video-context-buttons.ecr @@ -1,18 +1,18 @@
- " rel="noreferrer noopener" href="https://www.youtube.com/watch<%=endpoint_params%>"> + " rel="noreferrer noopener" href="https://www.youtube.com/watch<%=endpoint_params%>"> - " href="/watch<%=endpoint_params%>&listen=1"> + " href="/watch<%=endpoint_params%>&listen=1"> <% if env.get("preferences").as(Preferences).automatic_instance_redirect%> - " href="/redirect?referer=%2Fwatch<%=URI.encode_www_form(endpoint_params)%>"> + " href="/redirect?referer=%2Fwatch<%=URI.encode_www_form(endpoint_params)%>"> <% else %> - " href="https://redirect.invidious.io/watch<%=endpoint_params%>"> + " href="https://redirect.invidious.io/watch<%=endpoint_params%>"> <% end %> diff --git a/src/invidious/views/create_playlist.ecr b/src/invidious/views/create_playlist.ecr index feff65221..807244e6d 100644 --- a/src/invidious/views/create_playlist.ecr +++ b/src/invidious/views/create_playlist.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= I18n.translate(locale, "Create playlist") %> - Invidious +<%= translate(locale, "Create playlist") %> - Invidious <% end %>
@@ -8,25 +8,25 @@
- <%= I18n.translate(locale, "Create playlist") %> + <%= translate(locale, "Create playlist") %>
- - "> + + ">
- +
diff --git a/src/invidious/views/delete_playlist.ecr b/src/invidious/views/delete_playlist.ecr index 6e296153e..cd66b9630 100644 --- a/src/invidious/views/delete_playlist.ecr +++ b/src/invidious/views/delete_playlist.ecr @@ -1,20 +1,20 @@ <% content_for "header" do %> -<%= I18n.translate(locale, "Delete playlist") %> - Invidious +<%= translate(locale, "Delete playlist") %> - Invidious <% end %>
- <%= I18n.translate(locale, "Delete playlist `x`?", %|"#{HTML.escape(playlist.title)}"|) %> + <%= 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 123a5d443..34157c675 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) %> | - <%= I18n.translate_count(locale, "generic_videos_count", playlist.video_count) %> | + <%= 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 cfa5c7e19..13fe41479 100644 --- a/src/invidious/views/feeds/history.ecr +++ b/src/invidious/views/feeds/history.ecr @@ -1,19 +1,19 @@ <% content_for "header" do %> -<%= I18n.translate(locale, "History") %> - Invidious +<%= translate(locale, "History") %> - Invidious <% end %>
-

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

+

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

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

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

+

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

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

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

+

<%= 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 4177e53d6..5fbe539c9 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" %> - <%= I18n.translate(locale, "Popular") %> - Invidious + <%= translate(locale, "Popular") %> - Invidious <% else %> Invidious <% end %> diff --git a/src/invidious/views/feeds/subscriptions.ecr b/src/invidious/views/feeds/subscriptions.ecr index 57e205260..c36bd00fd 100644 --- a/src/invidious/views/feeds/subscriptions.ecr +++ b/src/invidious/views/feeds/subscriptions.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<title><%= I18n.translate(locale, "Subscriptions") %> - Invidious +<%= translate(locale, "Subscriptions") %> - Invidious <% end %> @@ -8,12 +8,12 @@
@@ -26,7 +26,7 @@ <% if CONFIG.enable_user_notifications %>
- <%= I18n.translate_count(locale, "subscriptions_unseen_notifs_count", notifications.size) %> + <%= 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 dcd1f6862..7dc416c6f 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" %> - <%= I18n.translate(locale, "Trending") %> - Invidious + <%= 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 %>"> - <%= I18n.translate(locale, "View as playlist") %> + <%= translate(locale, "View as playlist") %> </a> <% end %> </div> @@ -24,10 +24,10 @@ <% {"Default", "Music", "Gaming", "Movies"}.each do |option| %> <div class="pure-u-1 pure-md-1-3"> <% if trending_type == option %> - <b><%= I18n.translate(locale, option) %></b> + <b><%= translate(locale, option) %></b> <% else %> <a href="/feed/trending?type=<%= option %>®ion=<%= region %>"> - <%= I18n.translate(locale, option) %> + <%= translate(locale, option) %> </a> <% end %> </div> diff --git a/src/invidious/views/licenses.ecr b/src/invidious/views/licenses.ecr index 0776b0d7d..3037f3d7a 100644 --- a/src/invidious/views/licenses.ecr +++ b/src/invidious/views/licenses.ecr @@ -7,7 +7,7 @@ </head> <body> - <h1><%= I18n.translate(locale, "JavaScript license information") %></h1> + <h1><%= 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"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/iv-org/videojs-quality-selector"><%= translate(locale, "source") %></a> </td> </tr> @@ -33,7 +33,7 @@ </td> <td> - <a href="https://github.com/mpetazzoni/sse.js"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/mpetazzoni/sse.js"><%= translate(locale, "source") %></a> </td> </tr> @@ -47,7 +47,7 @@ </td> <td> - <a href="https://github.com/videojs/videojs-contrib-quality-levels"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/videojs/videojs-contrib-quality-levels"><%= translate(locale, "source") %></a> </td> </tr> @@ -61,7 +61,7 @@ </td> <td> - <a href="https://github.com/jfujita/videojs-http-source-selector"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/jfujita/videojs-http-source-selector"><%= translate(locale, "source") %></a> </td> </tr> @@ -75,7 +75,7 @@ </td> <td> - <a href="https://github.com/mister-ben/videojs-mobile-ui"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/mister-ben/videojs-mobile-ui"><%= translate(locale, "source") %></a> </td> </tr> @@ -89,7 +89,7 @@ </td> <td> - <a href="https://github.com/spchuang/videojs-markers"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/spchuang/videojs-markers"><%= translate(locale, "source") %></a> </td> </tr> @@ -103,7 +103,7 @@ </td> <td> - <a href="https://github.com/brightcove/videojs-overlay"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/brightcove/videojs-overlay"><%= translate(locale, "source") %></a> </td> </tr> @@ -117,7 +117,7 @@ </td> <td> - <a href="https://github.com/mkhazov/videojs-share"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/mkhazov/videojs-share"><%= translate(locale, "source") %></a> </td> </tr> @@ -131,7 +131,7 @@ </td> <td> - <a href="https://github.com/chrisboustead/videojs-vtt-thumbnails"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/chrisboustead/videojs-vtt-thumbnails"><%= translate(locale, "source") %></a> </td> </tr> @@ -145,7 +145,7 @@ </td> <td> - <a href="https://github.com/afrmtbl/videojs-youtube-annotations"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/afrmtbl/videojs-youtube-annotations"><%= translate(locale, "source") %></a> </td> </tr> @@ -159,7 +159,7 @@ </td> <td> - <a href="https://github.com/videojs/videojs-vr"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/videojs/videojs-vr"><%= translate(locale, "source") %></a> </td> </tr> @@ -173,7 +173,7 @@ </td> <td> - <a href="https://github.com/videojs/video.js"><%= I18n.translate(locale, "source") %></a> + <a href="https://github.com/videojs/video.js"><%= translate(locale, "source") %></a> </td> </tr> diff --git a/src/invidious/views/message.ecr b/src/invidious/views/message.ecr index 789846faa..8c7bf6113 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="<%= I18n.translate(locale, "An alternative front-end to YouTube") %>"> +<meta name="description" content="<%= 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 e41662c8f..c27ddba60 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 %> - <%= I18n.translate_count(locale, "generic_videos_count", playlist.video_count) %> | - <%= I18n.translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> | + <%= translate_count(locale, "generic_videos_count", playlist.video_count) %> | + <%= translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> | <% case playlist.as(InvidiousPlaylist).privacy when %> <% when PlaylistPrivacy::Public %> - <%= I18n.translate(locale, "Public") %> + <%= translate(locale, "Public") %> <% when PlaylistPrivacy::Unlisted %> - <%= I18n.translate(locale, "Unlisted") %> + <%= translate(locale, "Unlisted") %> <% when PlaylistPrivacy::Private %> - <%= I18n.translate(locale, "Private") %> + <%= translate(locale, "Private") %> <% end %> <% else %> @@ -76,25 +76,25 @@ <% subtitle = playlist.subtitle || "" %> <%= HTML.escape(subtitle[0..subtitle.rindex(" • ") || subtitle.size]) %> | <% end %> - <%= I18n.translate_count(locale, "generic_videos_count", playlist.video_count) %> | - <%= I18n.translate(locale, "Updated `x` ago", recode_date(playlist.updated, locale)) %> + <%= translate_count(locale, "generic_videos_count", playlist.video_count) %> | + <%= 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 de5c8dc69..fb03a44c9 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(I18n.translate(locale, "View YouTube comments")), + "youtube_comments_text" => HTML.escape(translate(locale, "View YouTube comments")), "reddit_comments_text" => "", "reddit_permalink_text" => "", - "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")), + "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")), "params" => { "comments": ["youtube"] }, diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index 2ffe27a16..b13002140 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -11,9 +11,9 @@ <%- if items.empty? -%>
- <%= 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) %> + <%= translate(locale, "search_message_no_results") %>

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

+ <%= 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 911526d14..2424a1cf7 100644 --- a/src/invidious/views/search_homepage.ecr +++ b/src/invidious/views/search_homepage.ecr @@ -1,7 +1,7 @@ <% content_for "header" do %> -"> +"> - Invidious - <%= I18n.translate(locale, "search") %> + Invidious - <%= translate(locale, "search") %> <% end %> diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 3b0391129..9904b4fca 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -42,7 +42,7 @@ <% else %> <% if CONFIG.login_enabled %> <% end %> @@ -118,38 +118,38 @@ <% if CONFIG.modified_source_code_url %> - <%= I18n.translate(locale, "footer_original_source_code") %> / - <%= I18n.translate(locale, "footer_modfied_source_code") %> + <%= translate(locale, "footer_original_source_code") %> / + <%= translate(locale, "footer_modfied_source_code") %> <% else %> - <%= I18n.translate(locale, "footer_source_code") %> + <%= translate(locale, "footer_source_code") %> <% end %> - <%= I18n.translate(locale, "footer_documentation") %> + <%= translate(locale, "footer_documentation") %>
- <%= I18n.translate(locale, "footer_donate_page") %> + <%= translate(locale, "footer_donate_page") %> - <%= I18n.translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> @ <%= CURRENT_BRANCH %> + <%= translate(locale, "Current version: ") %> <%= CURRENT_VERSION %>-<%= CURRENT_COMMIT %> @ <%= CURRENT_BRANCH %>
@@ -163,8 +163,8 @@ diff --git a/src/invidious/views/user/authorize_token.ecr b/src/invidious/views/user/authorize_token.ecr index 581fc1d56..725f392ed 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 %> -<%= I18n.translate(locale, "Token") %> - Invidious +<%= translate(locale, "Token") %> - Invidious <% end %> <% if env.get? "access_token" %> @@ -30,9 +30,9 @@
<% if callback_url %> - <%= I18n.translate(locale, "Authorize token for `x`?", "#{callback_url.scheme}://#{callback_url.host}") %> + <%= translate(locale, "Authorize token for `x`?", "#{callback_url.scheme}://#{callback_url.host}") %> <% else %> - <%= I18n.translate(locale, "Authorize token?") %> + <%= 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 e22891d69..1b9eb82e1 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 %> -<%= I18n.translate(locale, "Change password") %> - Invidious +<%= translate(locale, "Change password") %> - Invidious <% end %>
@@ -7,20 +7,20 @@
- <%= I18n.translate(locale, "Change password") %> + <%= 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 a50b113a2..c9acbe448 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 %> -<%= I18n.translate(locale, "Clear watch history") %> - Invidious +<%= translate(locale, "Clear watch history") %> - Invidious <% end %>
- <%= I18n.translate(locale, "Clear watch history?") %> + <%= translate(locale, "Clear watch history?") %>
diff --git a/src/invidious/views/user/data_control.ecr b/src/invidious/views/user/data_control.ecr index 1ada97122..e57926f50 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 %> -<%= I18n.translate(locale, "Import and Export Data") %> - Invidious +<%= translate(locale, "Import and Export Data") %> - Invidious <% end %>
- <%= I18n.translate(locale, "Import") %> + <%= translate(locale, "Import") %>
- +
- +
- +
- +
- +
- +
- +
- <%= I18n.translate(locale, "Export") %> + <%= translate(locale, "Export") %>
diff --git a/src/invidious/views/user/delete_account.ecr b/src/invidious/views/user/delete_account.ecr index dfc852fb6..67351bbf4 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 %> -<%= I18n.translate(locale, "Delete account") %> - Invidious +<%= translate(locale, "Delete account") %> - Invidious <% end %>
- <%= I18n.translate(locale, "Delete account?") %> + <%= translate(locale, "Delete account?") %>
diff --git a/src/invidious/views/user/login.ecr b/src/invidious/views/user/login.ecr index 4324133ae..7ac96bc6f 100644 --- a/src/invidious/views/user/login.ecr +++ b/src/invidious/views/user/login.ecr @@ -1,5 +1,5 @@ <% content_for "header" do %> -<%= I18n.translate(locale, "Log in") %> - Invidious +<%= 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 0d9c53666..cf8b55936 100644 --- a/src/invidious/views/user/preferences.ecr +++ b/src/invidious/views/user/preferences.ecr @@ -1,49 +1,49 @@ <% content_for "header" do %> -<%= I18n.translate(locale, "Preferences") %> - Invidious +<%= translate(locale, "Preferences") %> - Invidious <% end %>
- <%= I18n.translate(locale, "preferences_category_player") %> + <%= 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,108 +64,108 @@ <% 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 %>>
- <%= I18n.translate(locale, "preferences_category_visual") %> + <%= translate(locale, "preferences_category_visual") %>
- +
- +
- +
- +
- + checked<% end %>>
@@ -176,187 +176,187 @@ <% end %>
- +
- + <% (feed_options.size - 1).times do |index| %> <% end %>
<% if env.get? "user" %>
- + checked<% end %>>
<% end %> - <%= I18n.translate(locale, "preferences_category_misc") %> + <%= translate(locale, "preferences_category_misc") %>
- + checked<% end %>>
<% if env.get? "user" %> - <%= I18n.translate(locale, "preferences_category_subscription") %> + <%= 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 %> - <%= I18n.translate(locale, "preferences_category_admin") %> + <%= 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" %> - <%= I18n.translate(locale, "preferences_category_data") %> + <%= 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 4da2e9fbb..d566e2285 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 %> -<%= I18n.translate(locale, "Subscription manager") %> - Invidious +<%= 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 85be838ac..8431deb04 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 %> -<%= I18n.translate(locale, "Token manager") %> - Invidious +<%= translate(locale, "Token manager") %> - Invidious <% end %>

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

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

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

+

<%= 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 f302ff66d..6f9ced6fc 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(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")), + "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")), "params" => params, "preferences" => preferences, "premiere_timestamp" => video.premiere_timestamp.try &.to_unix, @@ -78,11 +78,11 @@ we're going to need to do it here in order to allow for translations.

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

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

<% end %> @@ -100,11 +100,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| I18n.translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %> + <%= video.premiere_timestamp.try { |t| translate(locale, "Premieres in `x`", recode_date((t - Time.utc).ago, locale)) } %>

<% elsif video.live_now %>

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

<% end %>
@@ -123,13 +123,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 -%> - <%= I18n.translate(locale, "videoinfo_watch_on_youTube") %> - (<%= I18n.translate(locale, "videoinfo_youTube_embed_link") %>) + <%= translate(locale, "videoinfo_watch_on_youTube") %> + (<%= translate(locale, "videoinfo_youTube_embed_link") %>)

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

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

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