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

@@ -32,7 +32,7 @@ class _DocumentViewState extends State<DocumentView> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).documentPreviewPageTitle),
title: Text(S.of(context).preview),
),
body: PdfView(
builders: PdfViewBuilders<DefaultBuilderOptions>(

View File

@@ -112,11 +112,9 @@ class _DocumentsPageState extends State<DocumentsPage>
listener: (context, state) {
showSnackBar(
context,
S.of(context).documentsPageNewDocumentAvailableText,
S.of(context).newDocumentAvailable,
action: SnackBarActionConfig(
label: S
.of(context)
.documentUploadProcessingSuccessfulReloadActionText,
label: S.of(context).reload,
onPressed: () {
context.read<TaskStatusCubit>().acknowledgeCurrentTask();
context.read<DocumentsCubit>().reload();
@@ -202,7 +200,7 @@ class _DocumentsPageState extends State<DocumentsPage>
.resetSelection(),
),
title: Text(
"${state.selection.length} ${S.of(context).documentsSelectedText}",
"${state.selection.length} ${S.of(context).countSelected}",
),
actions: [
IconButton(
@@ -213,14 +211,13 @@ class _DocumentsPageState extends State<DocumentsPage>
);
}
return SearchAppBar(
hintText:
S.of(context).documentSearchSearchDocuments,
hintText: S.of(context).searchDocuments,
onOpenSearch: showDocumentSearchPage,
bottom: TabBar(
controller: _tabController,
tabs: [
Tab(text: S.of(context).documentsPageTitle),
Tab(text: S.of(context).savedViewsLabel),
Tab(text: S.of(context).documents),
Tab(text: S.of(context).views),
],
),
);
@@ -296,7 +293,7 @@ class _DocumentsPageState extends State<DocumentsPage>
_nestedScrollViewKey.currentState?.outerController.jumpTo(0);
},
label: Text(
S.of(context).scrollToTopLabel,
S.of(context).scrollToTop,
style: DefaultTextStyle.of(context).style.apply(
color: Theme.of(context).colorScheme.onPrimary,
),
@@ -411,7 +408,7 @@ class _DocumentsPageState extends State<DocumentsPage>
.bulkDelete(documentsState.selection);
showSnackBar(
context,
S.of(context).documentsPageBulkDeleteSuccessfulText,
S.of(context).documentsSuccessfullyDeleted,
);
context.read<DocumentsCubit>().resetSelection();
} on PaperlessServerException catch (error, stackTrace) {

View File

@@ -9,12 +9,12 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AlertDialog(
title: Text(S.of(context).documentsPageSelectionBulkDeleteDialogTitle),
title: Text(S.of(context).confirmDeletion),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
S.of(context).documentsPageSelectionBulkDeleteDialogWarningTextOne,
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(1),
),
const SizedBox(height: 16),
Text(
@@ -26,14 +26,13 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
),
),
const SizedBox(height: 16),
Text(
S.of(context).documentsPageSelectionBulkDeleteDialogContinueText),
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
),
TextButton(
style: ButtonStyle(
@@ -43,7 +42,7 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
onPressed: () {
Navigator.pop(context, true);
},
child: Text(S.of(context).genericActionDeleteLabel),
child: Text(S.of(context).delete),
),
],
);

View File

@@ -18,13 +18,13 @@ class DocumentsEmptyState extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
child: EmptyState(
title: S.of(context).documentsPageEmptyStateOopsText,
subtitle: S.of(context).documentsPageEmptyStateNothingHereText,
title: S.of(context).oops,
subtitle: S.of(context).thereSeemsToBeNothingHere,
bottomChild: state.filter != DocumentFilter.initial && onReset != null
? TextButton(
onPressed: onReset,
child: Text(
S.of(context).documentsEmptyStateResetFilterLabel,
S.of(context).resetFilter,
),
).padded()
: null,

View File

@@ -96,14 +96,14 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
Align(
alignment: Alignment.centerLeft,
child: Text(
S.of(context).documentFilterAdvancedLabel,
S.of(context).advanced,
style: Theme.of(context).textTheme.bodySmall,
),
),
FormBuilderExtendedDateRangePicker(
name: DocumentFilterForm.fkCreatedAt,
initialValue: widget.initialFilter.created,
labelText: S.of(context).documentCreatedPropertyLabel,
labelText: S.of(context).createdAt,
onChanged: (_) {
_checkQueryConstraints();
},
@@ -111,7 +111,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
FormBuilderExtendedDateRangePicker(
name: DocumentFilterForm.fkAddedAt,
initialValue: widget.initialFilter.added,
labelText: S.of(context).documentAddedPropertyLabel,
labelText: S.of(context).addedAt,
onChanged: (_) {
_checkQueryConstraints();
},
@@ -151,7 +151,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkDocumentType,
labelOptions: state.labels,
textFieldLabel: S.of(context).documentDocumentTypePropertyLabel,
textFieldLabel: S.of(context).documentType,
initialValue: widget.initialFilter.documentType,
prefixIcon: const Icon(Icons.description_outlined),
);
@@ -166,7 +166,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkCorrespondent,
labelOptions: state.labels,
textFieldLabel: S.of(context).documentCorrespondentPropertyLabel,
textFieldLabel: S.of(context).correspondent,
initialValue: widget.initialFilter.correspondent,
prefixIcon: const Icon(Icons.person_outline),
);
@@ -181,7 +181,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
formBuilderState: widget.formKey.currentState,
name: DocumentFilterForm.fkStoragePath,
labelOptions: state.labels,
textFieldLabel: S.of(context).documentStoragePathPropertyLabel,
textFieldLabel: S.of(context).storagePath,
initialValue: widget.initialFilter.storagePath,
prefixIcon: const Icon(Icons.folder_outlined),
);

View File

@@ -74,7 +74,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
visible: MediaQuery.of(context).viewInsets.bottom == 0,
child: FloatingActionButton.extended(
icon: const Icon(Icons.done),
label: Text(S.of(context).documentFilterApplyFilterLabel),
label: Text(S.of(context).apply),
onPressed: _onApplyFilter,
),
),
@@ -85,7 +85,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
TextButton.icon(
onPressed: _resetFilter,
icon: const Icon(Icons.refresh),
label: Text(S.of(context).documentFilterResetLabel),
label: Text(S.of(context).reset),
),
],
),
@@ -133,7 +133,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
),
Padding(
padding: EdgeInsets.only(left: _heightAnimationValue * 48),
child: Text(S.of(context).documentFilterTitle),
child: Text(S.of(context).filterDocuments),
),
],
),

View File

@@ -48,12 +48,12 @@ class _SortFieldSelectionBottomSheetState
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
S.of(context).documentsPageOrderByLabel,
S.of(context).orderBy,
style: Theme.of(context).textTheme.bodySmall,
textAlign: TextAlign.start,
),
TextButton(
child: Text(S.of(context).documentFilterApplyFilterLabel),
child: Text(S.of(context).apply),
onPressed: () {
widget.onSubmit(
_currentSortField,
@@ -105,12 +105,12 @@ class _SortFieldSelectionBottomSheetState
ButtonSegment(
icon: const FaIcon(FontAwesomeIcons.arrowDownAZ),
value: SortOrder.descending,
label: Text(S.of(context).sortDocumentDescending),
label: Text(S.of(context).descending),
),
ButtonSegment(
icon: const FaIcon(FontAwesomeIcons.arrowUpZA),
value: SortOrder.ascending,
label: Text(S.of(context).sortDocumentAscending),
label: Text(S.of(context).ascending),
),
],
emptySelectionAllowed: false,

View File

@@ -63,20 +63,19 @@ class TextQueryFormField extends StatelessWidget {
itemBuilder: (context) => [
PopupMenuItem(
child: ListTile(
title: Text(
S.of(context).documentFilterQueryOptionsTitleAndContentLabel),
title: Text(S.of(context).titleAndContent),
),
value: QueryType.titleAndContent,
),
PopupMenuItem(
child: ListTile(
title: Text(S.of(context).documentFilterQueryOptionsTitleLabel),
title: Text(S.of(context).title),
),
value: QueryType.title,
),
PopupMenuItem(
child: ListTile(
title: Text(S.of(context).documentFilterQueryOptionsExtendedLabel),
title: Text(S.of(context).extended),
),
value: QueryType.extended,
),
@@ -90,11 +89,11 @@ class TextQueryFormField extends StatelessWidget {
String _buildLabelText(BuildContext context, QueryType queryType) {
switch (queryType) {
case QueryType.title:
return S.of(context).documentFilterQueryOptionsTitleLabel;
return S.of(context).title;
case QueryType.titleAndContent:
return S.of(context).documentFilterQueryOptionsTitleAndContentLabel;
return S.of(context).titleAndContent;
case QueryType.extended:
return S.of(context).documentFilterQueryOptionsExtendedLabel;
return S.of(context).extended;
default:
return '';
}

View File

@@ -14,31 +14,24 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
Widget build(BuildContext context) {
assert(state.selection.isNotEmpty);
return AlertDialog(
title: Text(S.of(context).documentsPageSelectionBulkDeleteDialogTitle),
title: Text(S.of(context).confirmDeletion),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
//TODO: use plurals, didn't use because of crash... investigate later.
state.selection.length == 1
? S
.of(context)
.documentsPageSelectionBulkDeleteDialogWarningTextOne
: S
.of(context)
.documentsPageSelectionBulkDeleteDialogWarningTextMany,
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(
state.selection.length),
),
const SizedBox(height: 16),
...state.selection.map(_buildBulletPoint).toList(),
const SizedBox(height: 16),
Text(
S.of(context).documentsPageSelectionBulkDeleteDialogContinueText),
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
],
),
actions: [
TextButton(
onPressed: () => Navigator.pop(context, false),
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
),
TextButton(
style: ButtonStyle(
@@ -48,7 +41,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
onPressed: () {
Navigator.pop(context, true);
},
child: Text(S.of(context).genericActionDeleteLabel),
child: Text(S.of(context).delete),
),
],
);

View File

@@ -14,18 +14,18 @@ class ConfirmDeleteSavedViewDialog extends StatelessWidget {
Widget build(BuildContext context) {
return AlertDialog(
title: Text(
S.of(context).deleteViewDialogTitleText + view.name + "?",
S.of(context).deleteView + view.name + "?",
softWrap: true,
),
content: Text(S.of(context).deleteViewDialogContentText),
content: Text(S.of(context).doYouReallyWantToDeleteThisView),
actions: [
TextButton(
child: Text(S.of(context).genericActionCancelLabel),
child: Text(S.of(context).cancel),
onPressed: () => Navigator.pop(context, false),
),
TextButton(
child: Text(
S.of(context).genericActionDeleteLabel,
S.of(context).delete,
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
onPressed: () => Navigator.pop(context, true),

View File

@@ -34,19 +34,19 @@ class ViewTypeSelectionWidget extends StatelessWidget {
_buildViewTypeOption(
context,
type: ViewType.list,
label: S.of(context).viewTypeListOption,
label: S.of(context).list,
icon: Icons.list,
),
_buildViewTypeOption(
context,
type: ViewType.grid,
label: S.of(context).viewTypeGridOption,
label: S.of(context).grid,
icon: Icons.grid_view_rounded,
),
_buildViewTypeOption(
context,
type: ViewType.detailed,
label: S.of(context).viewTypeDetailedOption,
label: S.of(context).detailed,
icon: Icons.article_outlined,
),
],