mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-07 20:07:48 -06:00
feat: Renamed translation strings
This commit is contained in:
@@ -24,7 +24,7 @@ class AccountSettingsDialog extends StatelessWidget {
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(S.of(context).accountSettingsTitle),
|
||||
Text(S.of(context).account),
|
||||
const CloseButton(),
|
||||
],
|
||||
),
|
||||
@@ -49,7 +49,7 @@ class AccountSettingsDialog extends StatelessWidget {
|
||||
ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.person_add_rounded),
|
||||
title: Text(S.of(context).accountSettingsAddAnotherAccount),
|
||||
title: Text(S.of(context).addAnotherAccount),
|
||||
onTap: () {},
|
||||
),
|
||||
const Divider(),
|
||||
@@ -60,7 +60,7 @@ class AccountSettingsDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).appDrawerLogoutLabel,
|
||||
S.of(context).disconnect,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onError,
|
||||
),
|
||||
|
||||
@@ -15,7 +15,7 @@ class ApplicationSettingsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).settingsPageApplicationSettingsLabel),
|
||||
title: Text(S.of(context).applicationSettings),
|
||||
),
|
||||
body: ListView(
|
||||
children: const [
|
||||
|
||||
@@ -8,8 +8,7 @@ class SecuritySettingsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar:
|
||||
AppBar(title: Text(S.of(context).settingsPageSecuritySettingsLabel)),
|
||||
appBar: AppBar(title: Text(S.of(context).security)),
|
||||
body: ListView(
|
||||
children: const [
|
||||
BiometricAuthenticationSetting(),
|
||||
|
||||
@@ -9,7 +9,7 @@ class StorageSettingsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).settingsPageStorageSettingsLabel),
|
||||
title: Text(S.of(context).storage),
|
||||
),
|
||||
body: ListView(
|
||||
children: const [
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:paperless_mobile/core/bloc/paperless_server_information_state.da
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/pages/application_settings_page.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/pages/security_settings_page.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/pages/storage_settings_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
|
||||
class SettingsPage extends StatelessWidget {
|
||||
@@ -15,24 +14,21 @@ class SettingsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).appDrawerSettingsLabel),
|
||||
title: Text(S.of(context).settings),
|
||||
),
|
||||
bottomNavigationBar: BlocBuilder<PaperlessServerInformationCubit,
|
||||
PaperlessServerInformationState>(
|
||||
builder: (context, state) {
|
||||
final info = state.information!;
|
||||
|
||||
return ListTile(
|
||||
title: Text(
|
||||
S.of(context).appDrawerHeaderLoggedInAsText +
|
||||
" " +
|
||||
(info.username ?? 'unknown') +
|
||||
S.of(context).loggedInAs(info.username ?? 'unknown') +
|
||||
"@${info.host}",
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
subtitle: Text(
|
||||
S.of(context).serverInformationPaperlessVersionText +
|
||||
S.of(context).paperlessServerVersion +
|
||||
' ' +
|
||||
info.version.toString() +
|
||||
' (API v${info.apiVersion})',
|
||||
@@ -46,23 +42,21 @@ class SettingsPage extends StatelessWidget {
|
||||
children: [
|
||||
ListTile(
|
||||
// leading: const Icon(Icons.style_outlined),
|
||||
title: Text(S.of(context).settingsPageApplicationSettingsLabel),
|
||||
subtitle: Text(
|
||||
S.of(context).settingsPageApplicationSettingsDescriptionText),
|
||||
title: Text(S.of(context).applicationSettings),
|
||||
subtitle: Text(S.of(context).languageAndVisualAppearance),
|
||||
onTap: () => _goto(const ApplicationSettingsPage(), context),
|
||||
),
|
||||
ListTile(
|
||||
// leading: const Icon(Icons.security_outlined),
|
||||
title: Text(S.of(context).settingsPageSecuritySettingsLabel),
|
||||
subtitle:
|
||||
Text(S.of(context).settingsPageSecuritySettingsDescriptionText),
|
||||
title: Text(S.of(context).security),
|
||||
subtitle: Text(S.of(context).biometricAuthentication),
|
||||
onTap: () => _goto(const SecuritySettingsPage(), context),
|
||||
),
|
||||
// ListTile(
|
||||
// // leading: const Icon(Icons.storage_outlined),
|
||||
// title: Text(S.of(context).settingsPageStorageSettingsLabel),
|
||||
// title: Text(S.of(context).storage),
|
||||
// subtitle:
|
||||
// Text(S.of(context).settingsPageStorageSettingsDescriptionText),
|
||||
// Text(S.of(context).mangeFilesAndStorageSpace),
|
||||
// onTap: () => _goto(const StorageSettingsPage(), context),
|
||||
// ),
|
||||
],
|
||||
|
||||
@@ -12,21 +12,19 @@ class BiometricAuthenticationSetting extends StatelessWidget {
|
||||
builder: (context, settings) {
|
||||
return SwitchListTile(
|
||||
value: settings.isLocalAuthenticationEnabled,
|
||||
title: Text(S.of(context).appSettingsBiometricAuthenticationLabel),
|
||||
subtitle: Text(
|
||||
S.of(context).appSettingsBiometricAuthenticationDescriptionText),
|
||||
title: Text(S.of(context).biometricAuthentication),
|
||||
subtitle: Text(S.of(context).authenticateOnAppStart),
|
||||
onChanged: (val) async {
|
||||
final String localizedReason = val
|
||||
? S
|
||||
.of(context)
|
||||
.appSettingsEnableBiometricAuthenticationReasonText
|
||||
: S
|
||||
.of(context)
|
||||
.appSettingsDisableBiometricAuthenticationReasonText;
|
||||
final String localizedReason =
|
||||
S.of(context).authenticateToToggleBiometricAuthentication(
|
||||
val ? 'enable' : 'disable',
|
||||
);
|
||||
await context
|
||||
.read<ApplicationSettingsCubit>()
|
||||
.setIsBiometricAuthenticationEnabled(val,
|
||||
localizedReason: localizedReason);
|
||||
.setIsBiometricAuthenticationEnabled(
|
||||
val,
|
||||
localizedReason: localizedReason,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
|
||||
builder: (context, settings) {
|
||||
return ListTile(
|
||||
title: Text(S.of(context).settingsPageColorSchemeSettingLabel),
|
||||
title: Text(S.of(context).colors),
|
||||
subtitle: Text(
|
||||
translateColorSchemeOption(
|
||||
context,
|
||||
@@ -28,9 +28,8 @@ class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
onTap: () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => RadioSettingsDialog<ColorSchemeOption>(
|
||||
titleText: S.of(context).settingsPageColorSchemeSettingLabel,
|
||||
descriptionText:
|
||||
S.of(context).settingsPageColorSchemeSettingDialogDescription,
|
||||
titleText: S.of(context).colors,
|
||||
descriptionText: S.of(context).colorSchemeHint,
|
||||
options: [
|
||||
RadioOption(
|
||||
value: ColorSchemeOption.classic,
|
||||
@@ -47,9 +46,7 @@ class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
],
|
||||
footer: _isBelowAndroid12()
|
||||
? HintCard(
|
||||
hintText: S
|
||||
.of(context)
|
||||
.settingsPageColorSchemeSettingDynamicThemeingVersionMismatchWarning,
|
||||
hintText: S.of(context).colorSchemeNotSupportedWarning,
|
||||
hintIcon: Icons.warning_amber,
|
||||
)
|
||||
: null,
|
||||
|
||||
@@ -25,7 +25,7 @@ class _LanguageSelectionSettingState extends State<LanguageSelectionSetting> {
|
||||
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
|
||||
builder: (context, settings) {
|
||||
return ListTile(
|
||||
title: Text(S.of(context).settingsPageLanguageSettingLabel),
|
||||
title: Text(S.of(context).language),
|
||||
subtitle: Text(_languageOptions[settings.preferredLocaleSubtag]!),
|
||||
onTap: () => showDialog<String>(
|
||||
context: context,
|
||||
@@ -33,7 +33,7 @@ class _LanguageSelectionSettingState extends State<LanguageSelectionSetting> {
|
||||
footer: const Text(
|
||||
"* Work in progress, not fully translated yet. Some words may be displayed in English!",
|
||||
),
|
||||
titleText: S.of(context).settingsPageLanguageSettingLabel,
|
||||
titleText: S.of(context).language,
|
||||
options: [
|
||||
RadioOption(
|
||||
value: 'en',
|
||||
|
||||
@@ -41,11 +41,11 @@ class _RadioSettingsDialogState<T> extends State<RadioSettingsDialog<T>> {
|
||||
widget.confirmButton ??
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(S.of(context).genericActionCancelLabel)),
|
||||
child: Text(S.of(context).cancel)),
|
||||
widget.confirmButton ??
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, _groupValue),
|
||||
child: Text(S.of(context).genericActionOkLabel)),
|
||||
child: Text(S.of(context).ok)),
|
||||
],
|
||||
title: widget.titleText != null ? Text(widget.titleText!) : null,
|
||||
content: Column(
|
||||
|
||||
@@ -12,13 +12,13 @@ class ThemeModeSetting extends StatelessWidget {
|
||||
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
|
||||
builder: (context, settings) {
|
||||
return ListTile(
|
||||
title: Text(S.of(context).settingsPageAppearanceSettingTitle),
|
||||
title: Text(S.of(context).appearance),
|
||||
subtitle: Text(_mapThemeModeToLocalizedString(
|
||||
settings.preferredThemeMode, context)),
|
||||
onTap: () => showDialog<ThemeMode>(
|
||||
context: context,
|
||||
builder: (_) => RadioSettingsDialog<ThemeMode>(
|
||||
titleText: S.of(context).settingsPageAppearanceSettingTitle,
|
||||
titleText: S.of(context).appearance,
|
||||
initialValue: context
|
||||
.read<ApplicationSettingsCubit>()
|
||||
.state
|
||||
@@ -26,20 +26,15 @@ class ThemeModeSetting extends StatelessWidget {
|
||||
options: [
|
||||
RadioOption(
|
||||
value: ThemeMode.system,
|
||||
label: S
|
||||
.of(context)
|
||||
.settingsPageAppearanceSettingSystemThemeLabel,
|
||||
label: S.of(context).systemTheme,
|
||||
),
|
||||
RadioOption(
|
||||
value: ThemeMode.light,
|
||||
label: S
|
||||
.of(context)
|
||||
.settingsPageAppearanceSettingLightThemeLabel,
|
||||
label: S.of(context).lightTheme,
|
||||
),
|
||||
RadioOption(
|
||||
value: ThemeMode.dark,
|
||||
label:
|
||||
S.of(context).settingsPageAppearanceSettingDarkThemeLabel,
|
||||
label: S.of(context).darkTheme,
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -56,11 +51,11 @@ class ThemeModeSetting extends StatelessWidget {
|
||||
String _mapThemeModeToLocalizedString(ThemeMode theme, BuildContext context) {
|
||||
switch (theme) {
|
||||
case ThemeMode.system:
|
||||
return S.of(context).settingsThemeModeSystemLabel;
|
||||
return S.of(context).system;
|
||||
case ThemeMode.light:
|
||||
return S.of(context).settingsThemeModeLightLabel;
|
||||
return S.of(context).light;
|
||||
case ThemeMode.dark:
|
||||
return S.of(context).settingsThemeModeDarkLabel;
|
||||
return S.of(context).dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user