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:
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'job_name' => 'Quick sales :year',
|
||||
'hours_note' => 'Quick sale #:number',
|
||||
'payment_methods' => [
|
||||
'cash' => 'Cash',
|
||||
'card' => 'Debit card',
|
||||
],
|
||||
'sell' => [
|
||||
'title' => 'Quick sale',
|
||||
'intro' => 'Cash and card sales of consumer products. Prices include VAT. The duration of the products is recorded as your hours.',
|
||||
'products' => 'Products',
|
||||
'products_help' => 'Each press adds one to the sale.',
|
||||
'add_named' => 'Add :product, :price / :unit',
|
||||
'cart' => 'Sale',
|
||||
'cart_empty' => 'The sale has no products yet.',
|
||||
'line' => ':quantity × :price = :total',
|
||||
'line_hours' => 'Records :hours h as your hours.',
|
||||
'decrease_named' => 'Remove one: :product',
|
||||
'increase_named' => 'Add one: :product',
|
||||
'remove_named' => 'Remove from the sale: :product',
|
||||
'changed' => ':product: :quantity. Total :total.',
|
||||
'removed' => ':product removed. Total :total.',
|
||||
'no_products' => 'The price list has no consumer products in use.',
|
||||
'total' => 'Total :total (incl. VAT)',
|
||||
'payment_method' => 'Payment method',
|
||||
'customer' => 'Customer (optional)',
|
||||
'customer_search' => 'Search customers',
|
||||
'customer_search_description' => 'Leave empty if the customer is an anonymous consumer.',
|
||||
'customer_results' => '{0} No customers found.|{1} 1 customer found.|[2,*] :count customers found.',
|
||||
'choose_customer' => 'Choose customer :name',
|
||||
'change_customer' => 'Remove customer',
|
||||
'save' => 'Record sale',
|
||||
'saved' => 'Sale #:number recorded: :total, :method.',
|
||||
'hours_booked' => ':hours h were recorded as your hours.',
|
||||
'hours_not_booked' => 'The hours (:hours h) could not be recorded, because the day\'s hours have already been approved or the day would exceed 24 h. Enter them in the week view or ask management to cancel the approval.',
|
||||
'to_list' => 'The day\'s sales and cash day',
|
||||
],
|
||||
'index' => [
|
||||
'title' => 'Quick sales',
|
||||
'day_navigation' => 'Day selection',
|
||||
'previous' => 'Previous day',
|
||||
'today' => 'Today',
|
||||
'next' => 'Next day',
|
||||
'new_sale' => 'New sale',
|
||||
'sales' => 'Sales',
|
||||
'own_only' => 'You see your own sales. The cash day balance includes everyone\'s sales.',
|
||||
'seller' => 'Seller',
|
||||
'all_sellers' => 'All sellers',
|
||||
'none' => 'No sales on this day.',
|
||||
'unclosed' => 'Cash days not closed:',
|
||||
],
|
||||
'columns' => [
|
||||
'time' => 'Time',
|
||||
'number' => 'Number',
|
||||
'seller' => 'Seller',
|
||||
'customer' => 'Customer',
|
||||
'products' => 'Products',
|
||||
'payment_method' => 'Payment method',
|
||||
'total' => 'Amount',
|
||||
'actions' => 'Actions',
|
||||
],
|
||||
'anonymous' => 'Anonymous',
|
||||
'line' => ':quantity × :product at :price',
|
||||
'credit_of' => 'Credit for sale #:number',
|
||||
'credited_by' => 'Credited (#:number)',
|
||||
'credit' => 'Credit',
|
||||
'credit_named' => 'Credit sale #:number',
|
||||
'credit_title' => 'Credit the sale?',
|
||||
'credit_text' => 'A credit is recorded for sale #:number (:total) on this day, with the same products as negative amounts. Refund the customer with the same payment method (:method). The sale\'s hours do not change: correct them in the week view if needed.',
|
||||
'credit_confirm' => 'Record credit',
|
||||
'receipt_link' => 'Receipt',
|
||||
'receipt' => [
|
||||
'open' => 'Open receipt #:number (PDF, opens in a new tab)',
|
||||
'open_named' => 'Receipt #:number (PDF, opens in a new tab)',
|
||||
'title' => 'Receipt',
|
||||
'credit_title' => 'Credit receipt',
|
||||
'file' => 'receipt-:number.pdf',
|
||||
'number' => 'Receipt no.',
|
||||
'date' => 'Date',
|
||||
'seller' => 'Seller',
|
||||
'customer' => 'Customer',
|
||||
'payment_method' => 'Payment method',
|
||||
'credits' => 'Credits receipt no. :number',
|
||||
'business_id' => 'Business ID',
|
||||
'vat_number' => 'VAT number',
|
||||
'product' => 'Product',
|
||||
'quantity' => 'Quantity',
|
||||
'unit_price' => 'Unit price',
|
||||
'line_total' => 'Total',
|
||||
'total' => 'Total (incl. VAT)',
|
||||
'vat_heading' => 'Value added tax',
|
||||
'vat_rate' => 'VAT %',
|
||||
'net' => 'Excl. VAT',
|
||||
'vat' => 'VAT',
|
||||
'gross' => 'Incl. VAT',
|
||||
'thanks' => 'Thank you for your visit!',
|
||||
'company_missing' => 'Company details are missing: the admin fills them in under Company details.',
|
||||
],
|
||||
'credited' => 'Credit #:credit was recorded for sale #:number.',
|
||||
'cash_day' => [
|
||||
'title' => 'Cash day',
|
||||
'open' => 'The cash day is open.',
|
||||
'closed' => 'Cash day closed :at (:name).',
|
||||
'reopened' => 'Reopened :at (:name).',
|
||||
'balance' => 'Balance',
|
||||
'preview' => 'Balance formed on closing',
|
||||
'sale_count' => 'Sales (including credits)',
|
||||
'cash' => 'Cash',
|
||||
'card' => 'Debit card',
|
||||
'total' => 'Total',
|
||||
'vat_breakdown' => 'VAT breakdown',
|
||||
'vat_rate' => 'VAT',
|
||||
'gross' => 'Incl. VAT',
|
||||
'net' => 'Excl. VAT',
|
||||
'vat' => 'VAT',
|
||||
'item' => 'Item',
|
||||
'amount' => 'Amount',
|
||||
'close' => 'Close cash day',
|
||||
'close_title' => 'Close the cash day?',
|
||||
'close_text' => 'A balance is formed from the day\'s sales, and no more sales can be recorded for the day.',
|
||||
'closed_message' => 'Cash day :day closed.',
|
||||
'reopen' => 'Reopen cash day',
|
||||
'reopen_title' => 'Reopen the cash day?',
|
||||
'reopen_text' => 'The balance is removed, and it is formed again when the day is closed.',
|
||||
'reopened_message' => 'Cash day :day reopened.',
|
||||
],
|
||||
'errors' => [
|
||||
'empty' => 'Enter a quantity for at least one product.',
|
||||
'quantity' => 'Enter the quantity as a whole number 0–999.',
|
||||
'product' => 'The product is no longer on sale. Refresh the page.',
|
||||
'customer' => 'The customer was not found. Choose the customer again.',
|
||||
'day_closed' => 'The cash day is closed; ask management to reopen it.',
|
||||
'already_credited' => 'The sale has already been credited.',
|
||||
'credit_of_credit' => 'A credit cannot be credited.',
|
||||
'not_found' => 'The sale was not found.',
|
||||
'future' => 'A future cash day cannot be closed.',
|
||||
'not_closed' => 'The cash day is not closed.',
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user