Included the check for RTL languages

This commit is contained in:
RadoslavL 2023-09-27 11:37:01 +03:00
parent 905582db66
commit 7fe2af735d

View File

@ -6,10 +6,19 @@ module Invidious::Frontend::Pagination
private def first_page(str : String::Builder, locale : String?, url : String) private def first_page(str : String::Builder, locale : String?, url : String)
str << %(<a href=") << url << %(" class="pure-button pure-button-secondary">) str << %(<a href=") << url << %(" class="pure-button pure-button-secondary">)
str << translate(locale, "First page") if locale_is_rtl?(locale)
str << "&nbsp;&nbsp;" # Inverted arrow ("first" points to the right)
str << %(<i class="icon ion-ios-arrow-back"></i>) str << translate(locale, "First page")
str << "</a>" str << "&nbsp;&nbsp;"
str << %(<i class="icon ion-ios-arrow-forward"></i>)
else
# Regular arrow ("first" points to the left)
str << %(<i class="icon ion-ios-arrow-back"></i>)
str << "&nbsp;&nbsp;"
str << translate(locale, "First page")
end
str << "</a>"
end end
private def previous_page(str : String::Builder, locale : String?, url : String) private def previous_page(str : String::Builder, locale : String?, url : String)