From 5e4c35a18ff0d4bc89180cab7f6e065aff728362 Mon Sep 17 00:00:00 2001 From: cagnusmarlsen <91818868+cagnusmarlsen@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:39:23 +0530 Subject: [PATCH] Desktop: Fixes #9960: Creating a profile changes the language of Joplin (#10038) --- packages/lib/BaseApplication.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/lib/BaseApplication.ts b/packages/lib/BaseApplication.ts index 1d8839f7d..3387353a6 100644 --- a/packages/lib/BaseApplication.ts +++ b/packages/lib/BaseApplication.ts @@ -747,8 +747,15 @@ export default class BaseApplication { } if (Setting.value('firstStart')) { - const locale = shim.detectAndSetLocale(Setting); - reg.logger().info(`First start: detected locale as ${locale}`); + + // detectAndSetLocale sets the locale to the system default locale. + // Not calling it when a new profile is created ensures that the + // the language set by the user is not overridden by the system + // default language. + if (!Setting.value('isSubProfile')) { + const locale = shim.detectAndSetLocale(Setting); + reg.logger().info(`First start: detected locale as ${locale}`); + } Setting.skipDefaultMigrations(); if (Setting.value('env') === 'dev') {