feat: Renamed translation strings

This commit is contained in:
Anton Stubenbord
2023-02-16 20:55:10 +01:00
parent fb6f79f017
commit d1a49ac73d
80 changed files with 3281 additions and 3974 deletions

View File

@@ -74,7 +74,7 @@
// padding: EdgeInsets.zero,
// child: ListTile(
// leading: const Icon(Icons.bug_report),
// title: Text(S.of(context).appDrawerReportBugLabel),
// title: Text(S.of(context).reportABug),
// ),
// );
// }
@@ -85,7 +85,7 @@
// value: AppPopupMenuEntries.openSettings,
// child: ListTile(
// leading: const Icon(Icons.settings_outlined),
// title: Text(S.of(context).appDrawerSettingsLabel),
// title: Text(S.of(context).settings),
// ),
// );
// }
@@ -96,7 +96,7 @@
// value: AppPopupMenuEntries.openAboutThisAppDialog,
// child: ListTile(
// leading: const Icon(Icons.info_outline),
// title: Text(S.of(context).appDrawerAboutLabel),
// title: Text(S.of(context).aboutThisApp),
// ),
// );
// }
@@ -146,7 +146,7 @@
// applicationName: 'Paperless Mobile',
// applicationVersion: packageInfo.version + '+' + packageInfo.buildNumber,
// children: [
// Text(S.of(context).aboutDialogDevelopedByText('Anton Stubenbord')),
// Text(S.of(context).developedBy('Anton Stubenbord')),
// Link(
// uri: Uri.parse('https://github.com/astubenbord/paperless-mobile'),
// builder: (context, followLink) => GestureDetector(

View File

@@ -10,7 +10,7 @@ class DialogCancelButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TextButton(
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
onPressed: onTap ?? () => Navigator.pop(context),
);
}

View File

@@ -47,7 +47,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
Widget build(BuildContext context) {
return AlertDialog(
insetPadding: const EdgeInsets.all(24.0),
title: Text(S.of(context).extendedDateRangeDialogTitle),
title: Text(S.of(context).selectDateRange),
content: FormBuilder(
key: _formKey,
child: Column(
@@ -56,7 +56,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
children: [
_buildDateRangeQueryTypeSelection(),
Text(
S.of(context).extendedDateRangeDialogHintText,
S.of(context).hintYouCanAlsoSpecifyRelativeValues,
style: Theme.of(context).textTheme.bodySmall,
).paddedOnly(top: 8, bottom: 16),
Builder(
@@ -83,11 +83,11 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
),
actions: [
TextButton(
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
onPressed: () => Navigator.pop(context),
),
TextButton(
child: Text(S.of(context).genericActionSaveLabel),
child: Text(S.of(context).save),
onPressed: () {
_formKey.currentState?.save();
if (_formKey.currentState?.validate() ?? false) {
@@ -110,12 +110,12 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
ButtonSegment(
value: DateRangeType.absolute,
enabled: true,
label: Text(S.of(context).extendedDateRangeDialogAbsoluteLabel),
label: Text(S.of(context).absolute),
),
ButtonSegment(
value: DateRangeType.relative,
enabled: true,
label: Text(S.of(context).extendedDateRangeDialogRelativeLabel),
label: Text(S.of(context).relative),
),
],
selected: {_selectedDateRangeType},
@@ -133,7 +133,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
: null,
initialDate: _before?.subtract(const Duration(days: 1)),
decoration: InputDecoration(
labelText: S.of(context).extendedDateRangePickerAfterLabel,
labelText: S.of(context).after,
prefixIcon: const Icon(Icons.date_range),
suffixIcon: _after != null
? IconButton(
@@ -161,7 +161,7 @@ class _ExtendedDateRangeDialogState extends State<ExtendedDateRangeDialog> {
: null,
inputType: InputType.date,
decoration: InputDecoration(
labelText: S.of(context).extendedDateRangePickerBeforeLabel,
labelText: S.of(context).before,
prefixIcon: const Icon(Icons.date_range),
suffixIcon: _before != null
? IconButton(

View File

@@ -90,29 +90,21 @@ class _FormBuilderExtendedDateRangePickerState
return '${df.format(query.after!)} ${df.format(query.before!)}';
}
if (query.before != null) {
return '${S.of(context).extendedDateRangePickerBeforeLabel} ${df.format(query.before!)}';
return '${S.of(context).before} ${df.format(query.before!)}';
}
if (query.after != null) {
return '${S.of(context).extendedDateRangePickerAfterLabel} ${df.format(query.after!)}';
return '${S.of(context).after} ${df.format(query.after!)}';
}
} else if (query is RelativeDateRangeQuery) {
switch (query.unit) {
case DateRangeUnit.day:
return S
.of(context)
.extendedDateRangePickerLastDaysLabel(query.offset);
return S.of(context).lastNDays(query.offset);
case DateRangeUnit.week:
return S
.of(context)
.extendedDateRangePickerLastWeeksLabel(query.offset);
return S.of(context).lastNWeeks(query.offset);
case DateRangeUnit.month:
return S
.of(context)
.extendedDateRangePickerLastMonthsLabel(query.offset);
return S.of(context).lastNMonths(query.offset);
case DateRangeUnit.year:
return S
.of(context)
.extendedDateRangePickerLastYearsLabel(query.offset);
return S.of(context).lastNYears(query.offset);
default:
}
}

View File

@@ -46,14 +46,12 @@ class _FormBuilderRelativeDateRangePickerState
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(S.of(context).extendedDateRangeDialogRelativeLastLabel),
Text(S.of(context).last),
SizedBox(
width: 80,
child: TextFormField(
decoration: InputDecoration(
labelText: S
.of(context)
.extendedDateRangeDialogRelativeAmountLabel,
labelText: S.of(context).amount,
),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
@@ -92,9 +90,7 @@ class _FormBuilderRelativeDateRangePickerState
onChanged: (value) =>
field.didChange(field.value!.copyWith(unit: value)),
decoration: InputDecoration(
labelText: S
.of(context)
.extendedDateRangeDialogRelativeTimeUnitLabel,
labelText: S.of(context).timeUnit,
),
),
),
@@ -117,13 +113,13 @@ class _FormBuilderRelativeDateRangePickerState
String _dateRangeUnitToLocalizedString(DateRangeUnit unit, int? count) {
switch (unit) {
case DateRangeUnit.day:
return S.of(context).extendedDateRangePickerDayText(count ?? 1);
return S.of(context).days(count ?? 1);
case DateRangeUnit.week:
return S.of(context).extendedDateRangePickerWeekText(count ?? 1);
return S.of(context).weeks(count ?? 1);
case DateRangeUnit.month:
return S.of(context).extendedDateRangePickerMonthText(count ?? 1);
return S.of(context).months(count ?? 1);
case DateRangeUnit.year:
return S.of(context).extendedDateRangePickerYearText(count ?? 1);
return S.of(context).years(count ?? 1);
}
}
}

View File

@@ -49,19 +49,19 @@ class _RelativeDateRangePickerHelperState
List<_ExtendedDateRangeQueryOption> get _options => [
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastWeeksLabel(1),
S.of(context).lastNWeeks(1),
const RelativeDateRangeQuery(1, DateRangeUnit.week),
),
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastMonthsLabel(1),
S.of(context).lastNMonths(1),
const RelativeDateRangeQuery(1, DateRangeUnit.month),
),
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastMonthsLabel(3),
S.of(context).lastNMonths(3),
const RelativeDateRangeQuery(3, DateRangeUnit.month),
),
_ExtendedDateRangeQueryOption(
S.of(context).extendedDateRangePickerLastYearsLabel(1),
S.of(context).lastNYears(1),
const RelativeDateRangeQuery(1, DateRangeUnit.year),
),
];

View File

@@ -52,7 +52,7 @@ class HintCard extends StatelessWidget {
Align(
alignment: Alignment.bottomRight,
child: TextButton(
child: Text(S.of(context).genericAcknowledgeLabel),
child: Text(S.of(context).gotIt),
onPressed: onHintAcknowledged,
),
)

View File

@@ -21,7 +21,7 @@ class OfflineBanner extends StatelessWidget with PreferredSizeWidget {
),
),
Text(
S.of(context).genericMessageOfflineText,
S.of(context).youreOffline,
style: TextStyle(
color: Theme.of(context).colorScheme.onErrorContainer,
),

View File

@@ -15,7 +15,7 @@ class OfflineWidget extends StatelessWidget {
color: Theme.of(context).disabledColor,
size: (Theme.of(context).iconTheme.size ?? 24) * 3),
Text(
S.of(context).offlineWidgetText,
S.of(context).anInternetConnectionCouldNotBeEstablished,
textAlign: TextAlign.center,
),
],