From 3520c271181e021c9d87a6e6d8bf8f0121d1ec68 Mon Sep 17 00:00:00 2001 From: Stuart Date: Tue, 10 Nov 2026 17:44:12 +0100 Subject: [PATCH] CookTrace opens in the browser's language until someone picks one The language setting defaulted to 'en', and App.svelte applies any truthy value over the locale picked from the browser, so a Spanish or Swedish browser still got English, sign-in page included. The setting now starts empty, so the browser's language stands until one is picked, and Settings > Regional & Units shows the language in use while it's empty. --- CHANGELOG.md | 1 + src/components/settings/SettingsRegional.svelte | 4 ++-- src/stores/settings.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db97c2c7..5b4dc6ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed +- **CookTrace opens in your browser's language until you pick one.** The Language setting counted as English for anyone who hadn't chosen one, so a Spanish or Swedish browser still got English, the sign-in page included. Settings > Regional & Units shows the language in use until you pick one, and a language you pick still wins over the browser's. - **Newer USDA Foundation foods have their calories.** Many Foundation foods from USDA FoodData Central, such as "Yogurt, Greek, plain, whole milk", give their energy only as Atwater figures, which CookTrace didn't read, so pantry items added from them had 0 kcal. Search and Refresh from USDA now take USDA's calories from those figures. An item you already added stays as it is: tap **Edit** on it, then **Refresh from USDA**, then Save; a recipe's saved nutrition picks up the new values when it's calculated again. (found with [nutritrace#314](https://github.com/TraceApps/nutritrace/issues/314)) - **A backup from 1.4 brings back the whole cook diary, and the Android app drops what a restore took away.** On 1.5.0-dev01, restoring a backup made by CookTrace 1.4 lost the whole cook diary. After restoring a full backup, recipes, pantry items, cooks, shopping items, cookbooks, comments, recipe versions, categories, custom units and Trace chat messages made after the backup stayed in the Android app. It now drops them, along with a category or unit deleted just before the restore. A kitchen or invite made after the backup also stayed after the restore when the backup had none. API tokens and webhooks are now in the backup too, so a restore no longer removes them; one removed after the backup comes back with it, so remove it again. On a server with another `TOKEN_ENC_KEY` (or `JWT_SECRET`), a webhook's secret can't be read, so its deliveries fail until you make it again. - **Locked Out? says what disabling user management deletes.** It said your food and diary data would be kept; it deletes every account and its recipes, pantry and plans. The words now say so. diff --git a/src/components/settings/SettingsRegional.svelte b/src/components/settings/SettingsRegional.svelte index f4662927..909e2e53 100644 --- a/src/components/settings/SettingsRegional.svelte +++ b/src/components/settings/SettingsRegional.svelte @@ -2,7 +2,7 @@ // Regional & Units section — extracted from Settings.svelte. Owns // language, date/time format, measurement system, and energy unit. // Stores + AVAILABLE_LOCALES import verbatim from the shell. - import { _ } from 'svelte-i18n'; + import { _, locale } from 'svelte-i18n'; import { AVAILABLE_LOCALES } from '../../i18n/index.js'; import { language, dateFormat, timeFormat, measurementSystem, energyUnit, @@ -17,7 +17,7 @@
{$_('settings_page.regional.language_desc')}
- language.set(e.target.value)}> {#each AVAILABLE_LOCALES as loc} {/each} diff --git a/src/stores/settings.js b/src/stores/settings.js index d9946950..9b0f3b73 100644 --- a/src/stores/settings.js +++ b/src/stores/settings.js @@ -400,7 +400,8 @@ export const biometricLoginEnabled = createSettingStore('biometricLoginEnabled', export const forceMobileLayout = createSettingStore('forceMobileLayout', false); // ── User prefs (server-synced) ───────────────────────────────────────────── -export const language = createSettingStore('language', 'en'); +// Empty until someone picks a language: until then the browser's stands (src/i18n/index.js). +export const language = createSettingStore('language', ''); export const accentColor = createSettingStore('accentColor', 'mint'); // Page banners — three styles: // 'animated' = tall header with the page's illustrated SVG