fix: Language dropdown not displaying saved language correctly (#4518)

Root cause: In commit 7f9321eca, the refactoring incorrectly used object
notation ($config->language_code) on an array instead of array notation
($config['language_code']).

The settings property in OSPOS config is an array, so:
- $config->language_code returns null (object access on array)
- $config['language_code'] returns the actual value

This caused both functions to always fall back to defaults, making the
language dropdown show incorrect values.

Fix: Change both functions to use array notation:
- Line 25: $config['language_code'] (returns saved language code)
- Line 46: $config['language'] (returns saved language name)

Also fixed the wrong DEFAULT_LANGUAGE_CODE fallback on line 46 - should be
DEFAULT_LANGUAGE since current_language() returns a name not a code.

Fixes #4517

Co-authored-by: Ollama <ollama@steganos.dev>
This commit is contained in:
jekkos
2026-04-19 20:06:11 +00:00
committed by GitHub
parent 12e3c7e31f
commit 0a313aa09d

View File

@@ -22,7 +22,7 @@ function current_language_code(bool $load_system_language = false): string
}
}
return $config->language_code ?? DEFAULT_LANGUAGE_CODE;
return $config['language_code'] ?? DEFAULT_LANGUAGE_CODE;
}
/**
@@ -43,7 +43,7 @@ function current_language(bool $load_system_language = false): string
}
}
return $config->language ?? DEFAULT_LANGUAGE_CODE;
return $config['language'] ?? DEFAULT_LANGUAGE;
}
/**