Added relative days translations

This commit is contained in:
Alexis
2024-09-05 17:59:44 +02:00
parent 872e1be949
commit 74427a5056
2 changed files with 13 additions and 5 deletions

View File

@@ -59,7 +59,11 @@ export default defineI18nConfig(() => ({
date: {
start: "Start date",
end: "End date",
afterTomorrow: "In 2 days",
tomorrow: "Tomorrow",
today: "Today",
yesterday: "Yesterday",
beforeYesterday: "2 days ago",
fromTo: "From {startDate} to {endDate}",
while: "During {duration}",
},
@@ -199,7 +203,11 @@ export default defineI18nConfig(() => ({
date: {
start: "Date de début",
end: "Date de fin",
afterTomorrow: "Après-demain",
tomorrow: "Demain",
today: "Aujourd'hui",
yesterday: "Hier",
beforeYesterday: "Avant-hier",
fromTo: "Du {startDate} au {endDate}",
while: "Pendant {duration}",
},

View File

@@ -495,19 +495,19 @@ export const useCalendar = defineStore("calendar", () => {
if (formatting === "complex") {
// Handle if it's the same date
if (direction === "present") {
return "Aujourd'hui"
return t("entity.calendar.date.today")
}
if (differenceInDays === -2) {
return "Avant-hier"
return t("entity.calendar.date.beforeYesterday")
}
if (differenceInDays === -1) {
return "Hier"
return t("entity.calendar.date.yesterday")
}
if (differenceInDays === 1) {
return "Demain"
return t("entity.calendar.date.tomorrow")
}
if (differenceInDays === 2) {
return "Après-demain"
return t("entity.calendar.date.afterTomorrow")
}
// Get relevant prefix for the string