Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/components/base/Pagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:class="{ disabled: page === 1 }"
:tabindex="page === 1 ? -1 : 0"
class="left-arrow paginate has-icon"
aria-label="Previous Page"
:aria-label="formatMessage(messages.previousPageLabel)"
:href="linkFunction(page - 1)"
@click.prevent="page !== 1 ? switchPage(page - 1) : null"
>
Expand Down Expand Up @@ -41,7 +41,7 @@
}"
:tabindex="page === pages[pages.length - 1] ? -1 : 0"
class="right-arrow paginate has-icon"
aria-label="Next Page"
:aria-label="formatMessage(messages.nextPageLabel)"
:href="linkFunction(page + 1)"
@click.prevent="page !== pages[pages.length - 1] ? switchPage(page + 1) : null"
>
Expand All @@ -52,6 +52,18 @@
<script setup lang="ts">
import { computed } from 'vue'
import { GapIcon, LeftArrowIcon, RightArrowIcon } from '@'
import { useVIntl, defineMessages } from '@vintl/vintl'
const messages = defineMessages({
nextPageLabel: {
id: 'omorphia.component.pagination.label.next-page',
defaultMessage: 'Next Page',
},
previousPageLabel: {
id: 'omorphia.component.pagination.label.previous-page',
defaultMessage: 'Previous Page',
},
})
const { formatMessage } = useVIntl()

const emit = defineEmits<{
'switch-page': [page: number]
Expand Down
6 changes: 6 additions & 0 deletions locales/en-US/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,11 @@
},
"omorphia.component.environment-indicator.label.unsupported": {
"defaultMessage": "Unsupported"
},
"omorphia.component.pagination.label.next-page": {
"defaultMessage": "Next Page"
},
"omorphia.component.pagination.label.previous-page": {
"defaultMessage": "Previous Page"
}
}