feat(i18n): UI language selector (Settings → Appearance → Language) (T-462)
Make the localization usable: an app.locale select (English / Nederlands) in the Appearance category, applied live by root_shell — it parses app.locale and calls i18n.setLocale on boot + on settings change (setLocale is a no-op when unchanged). nl_NL registered in availableLocales. The ui-design skill now documents the locale-dir config and the rule to design for string-length variation (translations run ~20% longer; never hard-size to the English label). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:clide/builtin/theme_picker/src/settings_view.dart';
|
||||
import 'package:clide/builtin/theme_picker/src/theme_status_item.dart';
|
||||
import 'package:clide/extension/extension.dart';
|
||||
import 'package:clide/kernel/kernel.dart';
|
||||
import 'package:clide/widgets/widgets.dart' show kMonoFontSettingKey, kUiFontSettingKey;
|
||||
import 'package:clide/widgets/widgets.dart' show kLocaleSettingKey, kMonoFontSettingKey, kUiFontSettingKey;
|
||||
|
||||
class ThemePickerExtension extends ClideExtension {
|
||||
@override
|
||||
@@ -101,6 +101,26 @@ class ThemePickerExtension extends ClideExtension {
|
||||
),
|
||||
],
|
||||
),
|
||||
SettingsSection(
|
||||
label: 'Language',
|
||||
labelKey: 'settings.appearance.section.language',
|
||||
fields: [
|
||||
SettingsField(
|
||||
key: kLocaleSettingKey,
|
||||
kind: SettingsFieldKind.select,
|
||||
label: 'Language',
|
||||
labelKey: 'settings.appearance.field.language.label',
|
||||
help: 'Language for the app interface; applies live.',
|
||||
helpKey: 'settings.appearance.field.language.help',
|
||||
defaultValue: 'en_US',
|
||||
// Language names stay in their own language (no labelKey).
|
||||
options: [
|
||||
SettingsOption(value: 'en_US', label: 'English'),
|
||||
SettingsOption(value: 'nl_NL', label: 'Nederlands'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user