Skip to content

Commit 3ba352f

Browse files
committed
settings
Signed-off-by: Zixuan James Li <[email protected]>
1 parent d5780b5 commit 3ba352f

12 files changed

+234
-24
lines changed

assets/l10n/app_en.arb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,22 @@
653653
"@messageIsMovedLabel": {
654654
"description": "Label for a moved message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
655655
},
656+
"themeSettingLabel": "THEME",
657+
"@themeSettingLabel": {
658+
"description": "Label for theme setting. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
659+
},
660+
"themeSettingDarkLabel": "Dark",
661+
"@themeSettingDarkLabel": {
662+
"description": "Label for dark theme setting."
663+
},
664+
"themeSettingLightLabel": "Light",
665+
"@themeSettingLightLabel": {
666+
"description": "Label for light theme setting."
667+
},
668+
"themeSettingSystemLabel": "System",
669+
"@themeSettingSystemLabel": {
670+
"description": "Label for following system theme setting."
671+
},
656672
"pollWidgetQuestionMissing": "No question.",
657673
"@pollWidgetQuestionMissing": {
658674
"description": "Text to display for a poll when the question is missing"

lib/generated/l10n/zulip_localizations.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,30 @@ abstract class ZulipLocalizations {
975975
/// **'MOVED'**
976976
String get messageIsMovedLabel;
977977

978+
/// Label for theme setting. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)
979+
///
980+
/// In en, this message translates to:
981+
/// **'THEME'**
982+
String get themeSettingLabel;
983+
984+
/// Label for dark theme setting.
985+
///
986+
/// In en, this message translates to:
987+
/// **'Dark'**
988+
String get themeSettingDarkLabel;
989+
990+
/// Label for light theme setting.
991+
///
992+
/// In en, this message translates to:
993+
/// **'Light'**
994+
String get themeSettingLightLabel;
995+
996+
/// Label for following system theme setting.
997+
///
998+
/// In en, this message translates to:
999+
/// **'System'**
1000+
String get themeSettingSystemLabel;
1001+
9781002
/// Text to display for a poll when the question is missing
9791003
///
9801004
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'MOVED';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'No question.';
522534

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'MOVED';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'No question.';
522534

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'MOVED';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'No question.';
522534

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'MOVED';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'No question.';
522534

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'PRZENIESIONO';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'Brak pytania.';
522534

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'ПЕРЕМЕЩЕНО';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'Нет вопроса.';
522534

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
517517
@override
518518
String get messageIsMovedLabel => 'PRESUNUTÉ';
519519

520+
@override
521+
String get themeSettingLabel => 'THEME';
522+
523+
@override
524+
String get themeSettingDarkLabel => 'Dark';
525+
526+
@override
527+
String get themeSettingLightLabel => 'Light';
528+
529+
@override
530+
String get themeSettingSystemLabel => 'System';
531+
520532
@override
521533
String get pollWidgetQuestionMissing => 'Bez otázky.';
522534

lib/model/settings.dart

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import '../generated/l10n/zulip_localizations.dart';
2+
13
/// The visual theme of the app.
24
///
35
/// See [zulipThemeData] for how themes are determined.
@@ -12,6 +14,13 @@ enum ThemeSetting {
1214
light,
1315

1416
/// Corresponds to [Brightness.dark].
15-
dark,
16-
}
17+
dark;
1718

19+
String displayName(ZulipLocalizations zulipLocalizations) {
20+
return switch (this) {
21+
ThemeSetting.unset => zulipLocalizations.themeSettingSystemLabel,
22+
ThemeSetting.light => zulipLocalizations.themeSettingLightLabel,
23+
ThemeSetting.dark => zulipLocalizations.themeSettingDarkLabel,
24+
};
25+
}
26+
}

0 commit comments

Comments
 (0)