Add English to the UI and a profile menu for language and theme

Every UI string now exists in lang/fi and lang/en; a unit test checks that
both languages have the same keys and placeholders. A user's language is
stored on the account (users.locale) and applied by the SetLocale web
middleware, falling back to the session's choice on signed-out pages and
then APP_LOCALE. Emails use the user's language through
HasLocalePreference, and the login page keeps the language after logout.

The header's name, theme toggle and logout button become one profile menu
(a disclosure) with the language buttons, light/dark/system theme radios
kept on the device, and logging out. Signed-out pages get a Suomi/English
switch next to the theme toggle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-25 06:28:39 +02:00
co-authored by Claude Opus 5.5
parent c2265256c3
commit 8aead06972
40 changed files with 2197 additions and 44 deletions
+198
View File
@@ -0,0 +1,198 @@
<?php
return [
'expense_line' => ':category :day: :what',
'csv' => [
'file' => 'billing-material-:number.csv',
'download' => 'Download CSV',
'download_short' => 'CSV',
'download_named' => 'Download CSV: Material :number',
'sensitive' => 'The file may contain consumer customers\' personal identity codes. Handle it as confidential and delete it once the data has been transferred to billing.',
'company' => 'Company',
'consumer' => 'Consumer',
'units' => [
'hours' => 'h',
'month' => 'mo',
'piece' => 'pcs',
],
'columns' => [
'Invoice', 'Customer', 'Customer type', 'Business ID', 'Personal identity code', 'Billing unit', 'Billing address',
'E-invoice address', 'Operator', 'Reference', 'Job', 'Job name', 'Line type', 'Description', 'Recorded h',
'Quantity', 'Unit', 'Unit price (c)', 'VAT (‰)', 'Excl. VAT (c)', 'VAT (c)', 'Incl. VAT (c)',
],
],
'statuses' => [
'draft' => 'Draft',
'created' => 'Created',
],
'modes' => [
'hours' => 'Hourly work',
'fixed_price' => 'Fixed price',
'monthly_fee' => 'Monthly fee',
'none' => 'Not billed through billing material',
],
'kinds' => [
'hours' => 'Hours',
'fixed_price' => 'Fixed price',
'expense' => 'Expense',
'monthly_fee' => 'Monthly fee',
],
'reasons' => [
'wrong_status' => 'The job is not done.',
'not_billable_basis' => 'The job is not billed through billing material (not billable, or an internal customer).',
'missing_monthly_fee' => 'The monthly billing job has no monthly fee.',
'missing_identity_code' => 'The customer\'s personal identity code is missing.',
'missing_hourly_rate' => 'Hourly rate missing: :names',
'missing_quoted_amount' => 'The fixed-price job has no quote amount.',
'nothing_to_bill' => 'Nothing to bill: no approved hours, unbilled months or billable expenses.',
],
'merge_refusals' => [
'different_customer' => 'The jobs have different customers.',
'different_billing_unit' => 'The jobs have different billing units.',
'different_reference' => 'The jobs have different customer references.',
'monthly_fee_alone' => 'A monthly billing job is billed on an invoice of its own.',
],
'index' => [
'title' => 'Billing',
'intro' => 'Once a month, the approved hours and billable expenses of done jobs are collected into billing material. The material is worked on as a draft, and creating it marks the lines as billed and moves the jobs to the status Invoice created.',
'new' => 'New material',
'continue' => 'Continue draft',
'none' => 'There is no billing material yet.',
'table' => 'Billing material',
'columns' => [
'number' => 'Material',
'status' => 'Status',
'created' => 'Started',
'finalized' => 'Created',
'invoices' => 'Invoices',
'jobs' => 'Jobs',
'net' => 'Amount excl. VAT',
'file' => 'File',
],
'export_label' => 'Material :number',
'draft_label' => 'Draft',
],
'export' => [
'title' => 'Billing material :number',
'draft_title' => 'Billing material draft',
'back' => 'All billing material',
'draft_info' => 'Draft, started by :name :at. Changes are saved immediately.',
'created_info' => 'Created :at by :name.',
'summary' => ':invoices invoices, :jobs jobs, total excl. VAT :net.',
'finalize' => 'Create material',
'finalize_title' => 'Create the billing material?',
'finalize_text' => 'The material will have :invoices invoices, total excl. VAT :net. Creating it marks the hours and expenses as billed and moves the jobs to the status Invoice created. Created material can no longer be changed.',
'finalized' => 'Billing material created: :invoices invoices.',
'discard' => 'Discard draft',
'discard_title' => 'Discard the draft?',
'discard_text' => 'The draft is deleted. Nothing has been billed yet, so the jobs stay as they are.',
'discarded' => 'Draft discarded.',
'problems' => 'Not all jobs can be billed. Fix or remove the marked jobs before creating the material.',
'period' => 'Billing month',
'period_help' => 'Monthly billing jobs are billed up to this month, including any skipped months.',
'period_saved' => 'The billing month is now :month.',
],
'invoices' => [
'title' => 'Invoices',
'none' => 'The draft has no jobs yet. Add done jobs below.',
'heading' => 'Invoice :number: :customer',
'billing_unit' => 'Billing unit',
'reference' => 'Customer reference',
'no_billing_unit' => 'No billing unit',
'no_reference' => 'No reference',
'totals' => 'Invoice totals',
'net' => 'Excl. VAT',
'vat' => 'VAT :rate',
'gross' => 'Incl. VAT',
'export_totals' => 'Material totals',
],
'jobs' => [
'open_job' => 'Open job :job',
'mode' => 'Billing method: :mode',
'unapproved' => 'Unapproved hours :hours h. They are not included in the material, and because the job moves to the status Invoice created, they will remain unbilled.',
'approvals_link' => 'Hour approval',
'hours_caption' => 'Hours by work type: :job',
'work_type' => 'Work type',
'approved_hours' => 'Approved h',
'billable_hours' => 'Billable h',
'billable_label' => 'Billable hours: :work_type',
'adjusted' => 'changed',
'rate' => 'Hourly rate',
'net' => 'Excl. VAT',
'no_rate' => 'Missing',
'billable_help' => 'By default the billable hours are the sum of the approved hours. An empty field restores the default.',
'fixed_price' => 'Fixed price: :amount',
'fixed_price_billed' => 'The fixed price has already been billed in earlier billing material.',
'fixed_hours' => 'The approved hours :hours h are shown for information and marked as billed.',
'monthly_hours' => 'The approved hours :hours h are included in the monthly fee and are marked as billed.',
'months_caption' => 'Billable months: :job',
'month' => 'Month',
'no_months' => 'No unbilled months.',
'no_hours' => 'No approved unbilled hours.',
'expenses_caption' => 'Expenses: :job',
'expense' => 'Expense',
'amount' => 'Excl. VAT',
'move_label' => 'Move to invoice: :job',
'move_placeholder' => 'Choose an invoice',
'move' => 'Move',
'move_named' => 'Move job :job',
'moved' => 'Job :job moved to the invoice.',
'separate' => 'Own invoice',
'separate_named' => 'Make job :job an invoice of its own',
'separated' => 'Job :job was made an invoice of its own.',
'remove' => 'Remove from material',
'remove_named' => 'Remove from material: :job',
'removed' => 'Job :job removed from the material.',
'hours_saved' => 'Billable hours saved: :job, :work_type.',
],
'lines' => [
'caption' => 'Invoice lines: :job',
'description' => 'Line',
'recorded' => 'Recorded h',
'quantity' => 'Billed h',
'unit_price' => 'Unit price',
'net' => 'Excl. VAT',
],
'available' => [
'title' => 'Billable jobs',
'intro' => 'Done jobs and monthly billing jobs that are not in the draft. Each added job is at first an invoice of its own.',
'none' => 'No other billable jobs.',
'columns' => [
'job' => 'Job',
'customer' => 'Customer',
'mode' => 'Billing method',
'hours' => 'Approved h',
'expenses' => 'Expenses',
'notes' => 'Notes',
'actions' => 'Actions',
],
'add' => 'Add to material',
'add_named' => 'Add to material: :job',
'added' => 'Job :job added to the material.',
'unapproved' => 'Not approved: :hours h',
],
'errors' => [
'draft_open' => 'A draft is already open. Continue it.',
'not_draft' => 'The material has already been created and cannot be changed.',
'not_found' => 'The billing material was not found.',
'empty' => 'The material has no jobs.',
'already_in_draft' => 'The job is already in the material.',
'not_in_draft' => 'The job is not in the material.',
'not_billable' => 'Job :job cannot be billed: :reason',
'hours' => 'Enter the hours in quarter hours, for example 12,5 or 3,25.',
'period' => 'Choose a month.',
],
];