Skip to content

Self-hosted house planner: true-scale 2D floor plan, 3D, satellite map overlay, sewer, electrical, water and underfloor heating with calculations, priced bill of materials. React + PHP, no database. By the team behind homedesignsai.pro

Default UI language to English

egmaltea12dc05f757
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 41c2210..42d76f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
## [Unreleased]
+### Changed
+
+- The UI defaults to English; the browser language is no longer used. Russian is picked only explicitly via "⋯" → Language or `?lang=ru`. PHP messages follow the `lang` cookie, otherwise English.
+
## [0.1.0] - 2026-10-01
Initial public release.
diff --git a/docs/guide/en/faq.md b/docs/guide/en/faq.md
index ad4dfd0..49d06dc 100644
--- a/docs/guide/en/faq.md
+++ b/docs/guide/en/faq.md
@@ -76,7 +76,7 @@ Mostly. Run it locally (Docker or `php -S`) and the editor, 3D, networks and est
### Which interface languages are there?
-English and Russian. The language follows the browser and can be switched in the "⋯" menu → Language; the choice is remembered. Translations to other languages are welcome: strings live in `src/i18n/locales/<language>/`, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
+English and Russian. English is the default regardless of the browser language; switch in the "⋯" menu → Language (the choice is remembered) or link with `?lang=ru` / `?lang=en`. Translations to other languages are welcome: strings live in `src/i18n/locales/<language>/`, see [CONTRIBUTING.md](../../../CONTRIBUTING.md).
### What is the license?
diff --git a/docs/guide/en/usage.md b/docs/guide/en/usage.md
index 98c1617..92e4276 100644
--- a/docs/guide/en/usage.md
+++ b/docs/guide/en/usage.md
@@ -2,7 +2,7 @@
**English** | [Русский](../ru/usage.md)
-The interface is in English and Russian; the language follows the browser and can be switched in "⋯" → Language. Labels below are the English ones.
+The interface is in English and Russian; English is the default (the browser language is ignored); switch in "⋯" → Language or open the app with `?lang=ru`. Labels below are the English ones.
## Layout
diff --git a/docs/guide/ru/faq.md b/docs/guide/ru/faq.md
index 2751487..cd43f62 100644
--- a/docs/guide/ru/faq.md
+++ b/docs/guide/ru/faq.md
@@ -76,7 +76,7 @@
### На каких языках интерфейс?
-На английском и русском. Язык берётся из браузера и переключается в меню «⋯» → «Язык», выбор запоминается. Переводы на другие языки приветствуются: строки лежат в `src/i18n/locales/<язык>/`, см. [CONTRIBUTING.md](../../../CONTRIBUTING.md).
+На английском и русском. По умолчанию английский независимо от языка браузера; переключается в меню «⋯» → «Язык» (выбор запоминается) или параметром `?lang=ru` / `?lang=en` в ссылке. Переводы на другие языки приветствуются: строки лежат в `src/i18n/locales/<язык>/`, см. [CONTRIBUTING.md](../../../CONTRIBUTING.md).
### Какая лицензия?
diff --git a/docs/guide/ru/usage.md b/docs/guide/ru/usage.md
index c6d65d9..f7da4b1 100644
--- a/docs/guide/ru/usage.md
+++ b/docs/guide/ru/usage.md
@@ -4,7 +4,7 @@
## Устройство экрана
-Интерфейс на английском и русском: язык берётся из браузера и переключается в «⋯» → «Язык». Ниже — подписи русской версии.
+Интерфейс на английском и русском: по умолчанию английский (язык браузера не учитывается), переключается в «⋯» → «Язык» или параметром `?lang=ru` в адресе. Ниже — подписи русской версии.
Разделы переключаются в шапке: «План», «3D», «Карта», «Смета», «Участок и дом». Адрес раздела — hash (`#/plan`, `#/3d`, `#/map`, `#/estimate`, `#/info`), любой раздел можно добавить в закладки. Справа в шапке — индикатор сохранения и меню «⋯»: экспорт и импорт JSON, версии.
diff --git a/public/api/_i18n.php b/public/api/_i18n.php
index ddae601..0e0de19 100644
--- a/public/api/_i18n.php
+++ b/public/api/_i18n.php
@@ -10,24 +10,7 @@ function ui_lang(): string
if ($cookie === 'en' || $cookie === 'ru') {
return $lang = $cookie;
}
- $best = 'en';
- $bestQ = -1.0;
- foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '') as $part) {
- $bits = explode(';', trim($part));
- $code = strtolower(substr(trim($bits[0]), 0, 2));
- if ($code !== 'en' && $code !== 'ru') {
- continue;
- }
- $q = 1.0;
- if (isset($bits[1]) && preg_match('/q=([\d.]+)/', $bits[1], $m)) {
- $q = (float) $m[1];
- }
- if ($q > $bestQ) {
- $best = $code;
- $bestQ = $q;
- }
- }
- return $lang = $best;
+ return $lang = 'en';
}
function tr(string $en, string $ru, ...$args): string
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index b36b42d..8a0c516 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -46,7 +46,8 @@ void i18n
saveMissing: import.meta.env.DEV,
missingKeyHandler: (_lngs, ns, key) => console.warn(`[i18n] missing key ${ns}:${key}`),
detection: {
- order: ['localStorage', 'cookie', 'navigator'],
+ order: ['querystring', 'localStorage', 'cookie'],
+ lookupQuerystring: 'lang',
lookupLocalStorage: 'lang',
lookupCookie: 'lang',
caches: ['localStorage', 'cookie'],