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
+98
View File
@@ -0,0 +1,98 @@
<?php
return [
'title' => 'Users',
'create_title' => 'New user',
'edit_title' => 'Edit user',
'new' => 'New user',
'edit' => 'Edit',
'actions' => 'Actions',
'save' => 'Save',
'cancel' => 'Cancel',
'search' => 'Search users',
'search_description' => 'Search by name or email.',
'empty' => 'No users found.',
'result_count' => '{0} No users|{1} :count user|[2,*] :count users',
'created' => 'User :name added. We sent them a link for setting a password to :email.',
'created_link_failed' => 'User :name added, but sending the link by email failed. Copy the link below and give it to the user.',
'updated' => 'Details of :name saved.',
'send_link' => 'Create a set-password link',
'link_sent' => 'A new link was created and sent to :email. Earlier links no longer work.',
'link_mail_failed' => 'A new link was created, but sending it by email failed. Copy the link below and give it to the user.',
'setup_link' => [
'label' => 'Set-password link',
'hint' => 'The link can be used once and is valid for :count hours. Give it only to the user themselves.',
'copy' => 'Copy link',
'copied' => 'Link copied to the clipboard.',
'copy_failed' => 'Copying failed. The link is selected: copy it with Ctrl+C.',
],
'fields' => [
'name' => 'Name',
'email' => 'Email',
'role' => 'Role',
'status' => 'Status',
'active' => 'Active',
'active_description' => 'An inactive user cannot sign in. Their data is kept.',
'employment_ends_on' => 'Last day of internship',
'employment_ends_on_description' => 'The intern can sign in until the end of this day.',
'supervisor' => 'Supervisor',
'supervisor_placeholder' => 'Choose a supervisor',
],
'roles' => [
'admin' => 'Admin',
'management' => 'Management',
'employee' => 'Employee',
'intern' => 'Intern',
'subcontractor' => 'Subcontractor',
],
'status' => [
'active' => 'Active',
'inactive' => 'Not in use',
'ends_on' => 'Ends :date',
'ended_on' => 'Ended :date',
],
'money_permissions' => [
'legend' => 'Visibility of amounts',
'hint' => 'Consumer product prices are visible to everyone. Other amounts are shown to employees and interns only for the selected areas; admins and management see everything.',
'prices' => 'Prices',
'prices_note' => 'hourly rates and other product prices',
'expenses' => 'Expenses',
'expenses_note' => 'expense amounts',
'quotes' => 'Quotes',
'quotes_note' => 'budget and quote amount',
'billing' => 'Billing',
'billing_note' => 'billing material and billed amounts',
],
'errors' => [
'invalid_money_permission' => 'Choose the visibility of amounts from the list.',
'name_required' => 'Enter a name.',
'invalid_name' => 'The name may be at most 255 characters.',
'email_required' => 'Enter an email address.',
'invalid_email' => 'The email address is not valid.',
'email_taken' => 'There is already a user with this email address.',
'role_required' => 'Choose a role.',
'end_date_required' => 'Enter the last day of the internship.',
'end_date_invalid' => 'The date is not valid.',
'supervisor_required' => 'Choose a supervisor for the intern.',
'invalid_supervisor' => 'The supervisor must be an active user with the management or employee role.',
'last_admin' => 'The last active admin cannot be deactivated or given another role.',
'supervisor_has_interns' => 'The user is the supervisor of active interns. First choose a new supervisor for the interns.',
],
'password_mail' => [
'subject' => 'Set your password',
'greeting' => 'Hello!',
'intro' => 'You can set a password for your account in the work management system with the button below.',
'action' => 'Set password',
'expires' => 'The link is valid for :count minutes.',
'expires_hours' => 'The link is valid for :count hours.',
'ignore' => 'If you were not expecting this message, you do not need to do anything.',
],
];