Replaced gettext with pgettext in the Pagination utility.

This commit is contained in:
依瑪貓 2023-02-04 13:26:58 +08:00
parent b5c0d0b7b3
commit e2f707f696

View File

@ -26,7 +26,7 @@ from urllib.parse import urlparse, parse_qsl, urlencode, urlunparse, \
from flask import request from flask import request
from werkzeug.routing import RequestRedirect from werkzeug.routing import RequestRedirect
from accounting.locale import gettext from accounting.locale import gettext, pgettext
class Link: class Link:
@ -203,7 +203,8 @@ class NonEmptyPagination(AbstractPagination[T]):
# The previous page. # The previous page.
uri = None if self.__page_no == 1 \ uri = None if self.__page_no == 1 \
else self.__uri_page(self.__page_no - 1) else self.__uri_page(self.__page_no - 1)
links.append(Link(gettext("Previous"), uri, is_for_mobile=True)) links.append(Link(pgettext("Pagination|", "Previous"), uri,
is_for_mobile=True))
# The first page. # The first page.
if self.__page_no > 1: if self.__page_no > 1:
@ -251,7 +252,8 @@ class NonEmptyPagination(AbstractPagination[T]):
# The next page. # The next page.
uri = None if self.__page_no == self.__total_pages \ uri = None if self.__page_no == self.__total_pages \
else self.__uri_page(self.__page_no + 1) else self.__uri_page(self.__page_no + 1)
links.append(Link(gettext("Next"), uri, is_for_mobile=True)) links.append(Link(pgettext("Pagination|", "Next"), uri,
is_for_mobile=True))
return links return links