diff --git a/public/locales/de.json b/public/locales/de.json index 4283d52..1002dc1 100644 --- a/public/locales/de.json +++ b/public/locales/de.json @@ -384,7 +384,14 @@ "catInsurance": "Versicherung", "catCraftsman": "Handwerker", "catEmergency": "Notfall", - "catMisc": "Sonstiges" + "catMisc": "Sonstiges", + "categoryDoctor": "Arzt", + "categorySchool": "Schule/Kita", + "categoryAuthority": "Behörde", + "categoryInsurance": "Versicherung", + "categoryCraftsman": "Handwerker", + "categoryEmergency": "Notfall", + "categoryOther": "Sonstiges" }, "budget": { diff --git a/public/locales/en.json b/public/locales/en.json index 6179c9c..e0b2754 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -384,7 +384,14 @@ "catInsurance": "Insurance", "catCraftsman": "Tradesperson", "catEmergency": "Emergency", - "catMisc": "Miscellaneous" + "catMisc": "Miscellaneous", + "categoryDoctor": "Doctor", + "categorySchool": "School/Daycare", + "categoryAuthority": "Authority", + "categoryInsurance": "Insurance", + "categoryCraftsman": "Tradesperson", + "categoryEmergency": "Emergency", + "categoryOther": "Other" }, "budget": { diff --git a/public/pages/budget.js b/public/pages/budget.js index bdfa7a2..4974b27 100644 --- a/public/pages/budget.js +++ b/public/pages/budget.js @@ -31,8 +31,11 @@ const CATEGORY_LABELS = () => ({ 'Sonstiges': t('budget.catMisc'), }); -const MONTH_NAMES = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', - 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']; +function getMonthName(monthIndex) { + // monthIndex: 0-based (0=Januar, 11=Dezember) + const date = new Date(2000, monthIndex, 1); + return new Intl.DateTimeFormat(document.documentElement.lang || 'de', { month: 'long' }).format(date); +} // -------------------------------------------------------- // State @@ -56,7 +59,7 @@ function formatAmount(n) { function formatMonthLabel(ym) { const [y, m] = ym.split('-'); - return `${MONTH_NAMES[parseInt(m, 10) - 1]} ${y}`; + return `${getMonthName(parseInt(m, 10) - 1)} ${y}`; } function addMonths(ym, n) { diff --git a/public/pages/contacts.js b/public/pages/contacts.js index 57d2b3c..cf568e9 100644 --- a/public/pages/contacts.js +++ b/public/pages/contacts.js @@ -26,6 +26,18 @@ const CATEGORY_ICONS = { 'Sonstiges': '📋', }; +function CATEGORY_LABELS() { + return { + 'Arzt': t('contacts.categoryDoctor'), + 'Schule/Kita': t('contacts.categorySchool'), + 'Behörde': t('contacts.categoryAuthority'), + 'Versicherung': t('contacts.categoryInsurance'), + 'Handwerker': t('contacts.categoryCraftsman'), + 'Notfall': t('contacts.categoryEmergency'), + 'Sonstiges': t('contacts.categoryOther'), + }; +} + // -------------------------------------------------------- // State // -------------------------------------------------------- @@ -66,7 +78,7 @@ export async function render(container, { user }) {