l10n: extract ThemeSwitchWidget strings

This commit is contained in:
Neeraj Gupta 2023-04-06 11:39:36 +05:30
parent f6b62b37dc
commit 18d4b7a759
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
4 changed files with 64 additions and 4 deletions

View file

@ -247,6 +247,7 @@ class MessageLookup extends MessageLookupByLibrary {
"criticalUpdateAvailable":
MessageLookupByLibrary.simpleMessage("Critical update available"),
"custom": MessageLookupByLibrary.simpleMessage("Custom"),
"darkTheme": MessageLookupByLibrary.simpleMessage("Dark"),
"decrypting": MessageLookupByLibrary.simpleMessage("Decrypting..."),
"deleteAccount": MessageLookupByLibrary.simpleMessage("Delete account"),
"deleteAccountFeedbackPrompt": MessageLookupByLibrary.simpleMessage(
@ -387,6 +388,7 @@ class MessageLookup extends MessageLookupByLibrary {
"keepPhotos": MessageLookupByLibrary.simpleMessage("Keep Photos"),
"kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage(
"Kindly help us with this information"),
"lightTheme": MessageLookupByLibrary.simpleMessage("Light"),
"linkDeviceLimit": MessageLookupByLibrary.simpleMessage("Device limit"),
"linkEnabled": MessageLookupByLibrary.simpleMessage("Enabled"),
"linkExpired": MessageLookupByLibrary.simpleMessage("Expired"),
@ -589,6 +591,7 @@ class MessageLookup extends MessageLookupByLibrary {
"suggestFeatures":
MessageLookupByLibrary.simpleMessage("Suggest features"),
"support": MessageLookupByLibrary.simpleMessage("Support"),
"systemTheme": MessageLookupByLibrary.simpleMessage("System"),
"tapToCopy": MessageLookupByLibrary.simpleMessage("tap to copy"),
"tapToEnterCode":
MessageLookupByLibrary.simpleMessage("Tap to enter code"),
@ -603,6 +606,7 @@ class MessageLookup extends MessageLookupByLibrary {
"termsOfServicesTitle": MessageLookupByLibrary.simpleMessage("Terms"),
"theDownloadCouldNotBeCompleted": MessageLookupByLibrary.simpleMessage(
"The download could not be completed"),
"theme": MessageLookupByLibrary.simpleMessage("Theme"),
"theyAlsoGetXGb": m25,
"thisCanBeUsedToRecoverYourAccountIfYou":
MessageLookupByLibrary.simpleMessage(

View file

@ -3747,6 +3747,46 @@ class S {
args: [],
);
}
/// `Theme`
String get theme {
return Intl.message(
'Theme',
name: 'theme',
desc: '',
args: [],
);
}
/// `Light`
String get lightTheme {
return Intl.message(
'Light',
name: 'lightTheme',
desc: '',
args: [],
);
}
/// `Dark`
String get darkTheme {
return Intl.message(
'Dark',
name: 'darkTheme',
desc: '',
args: [],
);
}
/// `System`
String get systemTheme {
return Intl.message(
'System',
name: 'systemTheme',
desc: '',
args: [],
);
}
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {

View file

@ -533,5 +533,9 @@
"reportABug": "Report a bug",
"reportBug": "Report bug",
"suggestFeatures": "Suggest features",
"support": "Support"
"support": "Support",
"theme": "Theme",
"lightTheme": "Light",
"darkTheme" : "Dark",
"systemTheme": "System"
}

View file

@ -1,7 +1,7 @@
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:photos/ente_theme_data.dart';
import "package:photos/generated/l10n.dart";
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/ui/components/captioned_text_widget.dart';
import 'package:photos/ui/components/expandable_menu_item_widget.dart';
@ -40,7 +40,7 @@ class _ThemeSwitchWidgetState extends State<ThemeSwitchWidget> {
@override
Widget build(BuildContext context) {
return ExpandableMenuItemWidget(
title: "Theme",
title: S.of(context).theme,
selectionOptionsWidget: _getSectionOptions(context),
leadingIcon: Theme.of(context).brightness == Brightness.light
? Icons.light_mode_outlined
@ -63,9 +63,21 @@ class _ThemeSwitchWidgetState extends State<ThemeSwitchWidget> {
}
Widget _menuItem(BuildContext context, AdaptiveThemeMode themeMode) {
late String themeName;
switch (themeMode) {
case AdaptiveThemeMode.light:
themeName = S.of(context).lightTheme;
break;
case AdaptiveThemeMode.dark:
themeName = S.of(context).darkTheme;
break;
case AdaptiveThemeMode.system:
themeName = S.of(context).systemTheme;
break;
}
return MenuItemWidget(
captionedTextWidget: CaptionedTextWidget(
title: toBeginningOfSentenceCase(themeMode.name)!,
title: themeName,
textStyle: Theme.of(context).colorScheme.enteTheme.textTheme.body,
),
pressedColor: getEnteColorScheme(context).fillFaint,