- Labels
+ {{ $t("home.labels") }}
{{ $t("labels.no_results") }}
diff --git a/frontend/pages/home/statistics.ts b/frontend/pages/home/statistics.ts
index 40ec1c2f..209509bf 100644
--- a/frontend/pages/home/statistics.ts
+++ b/frontend/pages/home/statistics.ts
@@ -1,3 +1,4 @@
+import { useI18n } from "vue-i18n";
import type { UserClient } from "~~/lib/api/user";
type StatCard = {
@@ -7,6 +8,8 @@ type StatCard = {
};
export function statCardData(api: UserClient) {
+ const { t } = useI18n();
+
const { data: statistics } = useAsyncData(async () => {
const { data } = await api.stats.group();
return data;
@@ -15,22 +18,22 @@ export function statCardData(api: UserClient) {
return computed(() => {
return [
{
- label: "Total Value",
+ label: t("home.total_value"),
value: statistics.value?.totalItemPrice || 0,
type: "currency",
},
{
- label: "Total Items",
+ label: t("home.total_items"),
value: statistics.value?.totalItems || 0,
type: "number",
},
{
- label: "Total Locations",
+ label: t("home.total_locations"),
value: statistics.value?.totalLocations || 0,
type: "number",
},
{
- label: "Total Labels",
+ label: t("home.total_labels"),
value: statistics.value?.totalLabels || 0,
type: "number",
},
diff --git a/frontend/pages/item/[id]/index.vue b/frontend/pages/item/[id]/index.vue
index 4ec23dd7..002fd0dc 100644
--- a/frontend/pages/item/[id]/index.vue
+++ b/frontend/pages/item/[id]/index.vue
@@ -153,35 +153,35 @@
const ret: Details = [
{
- name: "Quantity",
+ name: "items.quantity",
text: item.value?.quantity,
slot: "quantity",
},
{
- name: "Serial Number",
+ name: "items.serial_number",
text: item.value?.serialNumber,
copyable: true,
},
{
- name: "Model Number",
+ name: "items.model_number",
text: item.value?.modelNumber,
copyable: true,
},
{
- name: "Manufacturer",
+ name: "items.manufacturer",
text: item.value?.manufacturer,
copyable: true,
},
{
- name: "Insured",
+ name: "items.insured",
text: item.value?.insured ? "Yes" : "No",
},
{
- name: "Archived",
+ name: "items.archived",
text: item.value?.archived ? "Yes" : "No",
},
{
- name: "Notes",
+ name: "items.notes",
type: "markdown",
text: item.value?.notes,
},
@@ -230,28 +230,28 @@
const attachmentDetails = computed(() => {
const details: Detail[] = [];
- const push = (name: string) => {
+ const push = (name: string, slot: string) => {
details.push({
name,
text: "",
- slot: name.toLowerCase(),
+ slot: slot,
});
};
if (attachments.value.attachments.length > 0) {
- push("Attachments");
+ push("items.attachments", "attachments");
}
if (attachments.value.warranty.length > 0) {
- push("Warranty");
+ push("items.warranty", "warranty");
}
if (attachments.value.manuals.length > 0) {
- push("Manuals");
+ push("items.manuals", "manuals");
}
if (attachments.value.receipts.length > 0) {
- push("Receipts");
+ push("items.receipts", "receipts");
}
return details;
@@ -309,16 +309,16 @@
const purchaseDetails = computed(() => {
const v: Details = [
{
- name: "Purchased From",
+ name: "items.purchased_from",
text: item.value?.purchaseFrom || "",
},
{
- name: "Purchase Price",
- text: item.value?.purchasePrice || "",
+ name: "items.purchase_price",
+ text: String(item.value?.purchasePrice) || "",
type: "currency",
},
{
- name: "Purchase Date",
+ name: "items.purchase_date",
text: item.value?.purchaseTime || "",
type: "date",
date: true,
@@ -342,16 +342,16 @@
const soldDetails = computed(() => {
const v: Details = [
{
- name: "Sold To",
+ name: "items.sold_to",
text: item.value?.soldTo || "",
},
{
- name: "Sold Price",
- text: item.value?.soldPrice || "",
+ name: "items.sold_price",
+ text: String(item.value?.soldPrice) || "",
type: "currency",
},
{
- name: "Sold At",
+ name: "items.sold_at",
text: item.value?.soldTime || "",
type: "date",
date: true,
@@ -394,17 +394,17 @@
return [
{
id: "details",
- name: "Details",
+ name: "global.details",
to: `/item/${itemId.value}`,
},
{
id: "log",
- name: "Maintenance",
+ name: "global.maintenance",
to: `/item/${itemId.value}/maintenance`,
},
{
id: "edit",
- name: "Edit",
+ name: "global.edit",
to: `/item/${itemId.value}/edit`,
},
];
@@ -509,7 +509,7 @@
class="btn btn-sm"
:class="`${t.to === currentPath ? 'btn-active' : ''}`"
>
- {{ t.name }}
+ {{ $t(t.name) }}