fix(reports): localize latest voucher label (#1365)

Closes #1267
This commit is contained in:
Mattsson
2026-08-03 15:18:21 +02:00
committed by GitHub
parent 9e54a8e400
commit d9fb5da16d
6 changed files with 23 additions and 6 deletions
@@ -2,6 +2,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'
import { getLatestPostedVouchers } from '../latest-vouchers'
import { formatLatestVouchers, LATEST_VOUCHERS_LABEL } from '../latest-vouchers-format'
import { createQueuedMockSupabase } from '@/tests/helpers'
import enMessages from '../../../messages/en.json'
import svMessages from '../../../messages/sv.json'
beforeEach(() => {
vi.clearAllMocks()
@@ -184,4 +186,9 @@ describe('formatLatestVouchers', () => {
// the books, and a reconciler told the wrong one chases a phantom gap.
expect(LATEST_VOUCHERS_LABEL).toBe('Senaste bokförda verifikat')
})
it('keeps the web label explicit in both supported locales', () => {
expect(svMessages.reports.latest_posted_vouchers).toBe(LATEST_VOUCHERS_LABEL)
expect(enMessages.reports.latest_posted_vouchers).toBe('Latest posted vouchers')
})
})
+3 -1
View File
@@ -9,7 +9,9 @@ import type { LatestVoucherPerSeries } from '@/types'
*/
/**
* Swedish-only report surface (see .claude/rules/i18n.md).
* Swedish label for PDF and spreadsheet exports, whose complete document
* chrome currently renders in Swedish. Client views use the localized
* `reports.latest_posted_vouchers` message instead.
*
* The wording is load-bearing: this is the last POSTED number, not the last
* number the sequence counter handed out. A reconciler who assumes the other