Skip to content

Commit

Permalink
Add translations for video quality labels
Browse files Browse the repository at this point in the history
  • Loading branch information
syeopite committed Nov 14, 2023
1 parent 80b7134 commit 0c4c720
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,11 @@
"channel_tab_releases_label": "Releases",
"channel_tab_playlists_label": "Playlists",
"channel_tab_community_label": "Community",
"channel_tab_channels_label": "Channels"
"channel_tab_channels_label": "Channels",
"video_quality_livestream_label": "Livestreams",
"video_quality_hls_label": "HLS",
"video_quality_dash_label": "DASH",
"video_quality_hd720_label": "hd720",
"video_quality_medium_label": "medium",
"video_quality_small_label": "small"
}
8 changes: 4 additions & 4 deletions src/invidious/views/components/player.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<% if params.video_loop %>loop<% end %>
<% if params.controls %>controls<% end %>>
<% if (hlsvp = video.hls_manifest_url) && video.live_now && !CONFIG.disabled?("livestreams") %>
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="livestream">
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="<%= HTML.escape(translate(locale,"video_quality_livestream_label")) %>">
<% elsif (hlsvp = video.hls_manifest_url) && params.quality == "hls" && !CONFIG.disabled?("hls") %>
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="HLS">
<source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="<%= HTML.escape(translate(locale,"video_quality_hls_label")) %>">
<% else %>
<% if params.listen %>
<% # default to 128k m4a stream
Expand Down Expand Up @@ -36,7 +36,7 @@
<% end %>
<% else %>
<% if params.quality == "dash" %>
<source src="/api/manifest/dash/id/<%= video.id %>?local=true&unique_res=1" type='application/dash+xml' label="dash">
<source src="/api/manifest/dash/id/<%= video.id %>?local=true&unique_res=1" type='application/dash+xml' label="<%= HTML.escape(translate(locale,"video_quality_dash_label")) %>">
<% end %>

<%
Expand All @@ -51,7 +51,7 @@
selected = params.quality ? (params.quality == quality) : (i == 0)
%>
<source src="<%= src_url %>" type="<%= mimetype %>" label="<%= quality %>" selected="<%= selected %>">
<source src="<%= src_url %>" type="<%= mimetype %>" label="<%= HTML.escape(translate(locale,"video_quality_#{quality}_label")) %>" selected="<%= selected %>">
<% if !params.local && !CONFIG.disabled?("local") %>
<source src="<%= src_url %>&local=true" type="<%= mimetype %>" hidequalityoption="true">
<% end %>
Expand Down

0 comments on commit 0c4c720

Please sign in to comment.