From 41ae0d04951c36d0bcc9be7cde2c3f77ccc2b95d Mon Sep 17 00:00:00 2001 From: danloa Date: Tue, 5 Nov 2024 09:02:58 -0400 Subject: [PATCH 1/2] Add translations for statuses and pagination table --- resources/js/components/shared/PaginationTable.vue | 13 +++++++++---- resources/js/tasks/components/TasksList.vue | 8 ++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/resources/js/components/shared/PaginationTable.vue b/resources/js/components/shared/PaginationTable.vue index b6142be153..db0c9a77b3 100644 --- a/resources/js/components/shared/PaginationTable.vue +++ b/resources/js/components/shared/PaginationTable.vue @@ -27,7 +27,7 @@ > - of {{ totalPageCount }} + {{ totalPageCountLabel }} Date: Wed, 6 Nov 2024 15:10:04 -0400 Subject: [PATCH 2/2] Translate statuses and table footer for cases list --- .../js/components/shared/PaginationTable.vue | 2 -- .../jscomposition/system/table/Pagination.vue | 18 ++++++++++++------ .../system/table/cell/StatusCell.vue | 13 +++++++------ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/resources/js/components/shared/PaginationTable.vue b/resources/js/components/shared/PaginationTable.vue index db0c9a77b3..4938ceba08 100644 --- a/resources/js/components/shared/PaginationTable.vue +++ b/resources/js/components/shared/PaginationTable.vue @@ -130,11 +130,9 @@ export default { }, totalItems() { if (this.meta.total === 1) { - //return `${this.meta.total} ${this.$t("item")}`; return this.$t('{{count}} Item', { count: this.meta.total }); } return this.$t('{{count}} Items', { count: this.meta.total }); - //return `${this.meta.total} ${this.$t("items")}`; }, perPageButton() { return `${this.meta.per_page} ${this.$t("Per page")}`; diff --git a/resources/jscomposition/system/table/Pagination.vue b/resources/jscomposition/system/table/Pagination.vue index 57e5256059..e7b49e23a7 100644 --- a/resources/jscomposition/system/table/Pagination.vue +++ b/resources/jscomposition/system/table/Pagination.vue @@ -102,7 +102,7 @@
- {{ `${totalModel} items` }} + {{ totalModelLabel }}
@@ -116,7 +116,7 @@ class="tw-flex tw-full tw-items-center tw-space-x-2" @click.prevent.stop="toogleShow()"> - {{ `${selectedOption.value} ${$t("per page")}` }} + {{ `${selectedOption.value} ${$t("Per page")}` }} @@ -152,20 +152,26 @@ const props = defineProps({ const emit = defineEmits(["perPage", "go"]); -const totalModel = computed(() => props.total); +const totalModelLabel = computed(() => { + if (props.total === 0) { + return `${t("{{count}} Item", { count: props.total })}`; + } + return `${t("{{count}} Items", { count: props.total })}`; +}); + const pageModel = ref(props.page); const optionsPerPage = [ { value: 15, - label: `15 ${t("items")}`, + label: `${t("15 items")}`, }, { value: 30, - label: `30 ${t("items")}`, + label: `${t("30 items")}`, }, { value: 50, - label: `50 ${t("items")}`, + label: `${t("50 items")}`, }, ]; diff --git a/resources/jscomposition/system/table/cell/StatusCell.vue b/resources/jscomposition/system/table/cell/StatusCell.vue index 9556db9a3a..adb4a66aa9 100644 --- a/resources/jscomposition/system/table/cell/StatusCell.vue +++ b/resources/jscomposition/system/table/cell/StatusCell.vue @@ -9,31 +9,32 @@