From 7fe2af735db9ee98b1b87b46224abf4429833b8a Mon Sep 17 00:00:00 2001 From: RadoslavL Date: Wed, 27 Sep 2023 11:37:01 +0300 Subject: [PATCH] Included the check for RTL languages --- src/invidious/frontend/pagination.cr | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/invidious/frontend/pagination.cr b/src/invidious/frontend/pagination.cr index 85e588ff..40a9a62e 100644 --- a/src/invidious/frontend/pagination.cr +++ b/src/invidious/frontend/pagination.cr @@ -5,11 +5,20 @@ module Invidious::Frontend::Pagination private def first_page(str : String::Builder, locale : String?, url : String) str << %() + + if locale_is_rtl?(locale) + # Inverted arrow ("first" points to the right) + str << translate(locale, "First page") + str << "  " + str << %() + else + # Regular arrow ("first" points to the left) + str << %() + str << "  " + str << translate(locale, "First page") + end - str << translate(locale, "First page") - str << "  " - str << %() - str << "" + str << "" end private def previous_page(str : String::Builder, locale : String?, url : String)