From 62d6e2d75fa1cf7c95dcab69e356f9c3177e1666 Mon Sep 17 00:00:00 2001 From: Anton Stubenbord Date: Tue, 10 Oct 2023 16:41:40 +0200 Subject: [PATCH] feat: Update translations, improved saved views creation help --- lib/features/app_drawer/view/app_drawer.dart | 23 +++++++- .../saved_views/saved_views_widget.dart | 11 ++-- lib/features/landing/view/landing_page.dart | 6 +- lib/l10n/intl_ca.arb | 56 +++++++++---------- lib/l10n/intl_cs.arb | 4 -- lib/l10n/intl_de.arb | 4 -- lib/l10n/intl_en.arb | 4 -- lib/l10n/intl_es.arb | 4 -- lib/l10n/intl_fr.arb | 4 -- lib/l10n/intl_pl.arb | 4 -- lib/l10n/intl_ru.arb | 4 -- lib/l10n/intl_tr.arb | 4 -- 12 files changed, 59 insertions(+), 69 deletions(-) diff --git a/lib/features/app_drawer/view/app_drawer.dart b/lib/features/app_drawer/view/app_drawer.dart index 3714f4d..9b1d1dc 100644 --- a/lib/features/app_drawer/view/app_drawer.dart +++ b/lib/features/app_drawer/view/app_drawer.dart @@ -5,6 +5,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:paperless_mobile/constants.dart'; import 'package:paperless_mobile/core/database/tables/local_user_account.dart'; +import 'package:paperless_mobile/core/widgets/hint_card.dart'; import 'package:paperless_mobile/core/widgets/paperless_logo.dart'; import 'package:paperless_mobile/extensions/flutter_extensions.dart'; import 'package:paperless_mobile/features/documents/cubit/documents_cubit.dart'; @@ -12,6 +13,7 @@ import 'package:paperless_mobile/features/saved_view/cubit/saved_view_cubit.dart import 'package:paperless_mobile/features/sharing/cubit/receive_share_cubit.dart'; import 'package:paperless_mobile/generated/l10n/app_localizations.dart'; import 'package:paperless_mobile/routes/typed/branches/documents_route.dart'; +import 'package:paperless_mobile/routes/typed/branches/saved_views_route.dart'; import 'package:paperless_mobile/routes/typed/branches/upload_queue_route.dart'; import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart'; import 'package:paperless_mobile/routes/typed/top_level/settings_route.dart'; @@ -198,7 +200,26 @@ class AppDrawer extends StatelessWidget { .where((element) => element.showInSidebar) .toList(); if (sidebarViews.isEmpty) { - return Text("Nothing to show here.").paddedOnly(left: 16); + return Column( + children: [ + Text( + S.of(context)!.youDidNotSaveAnyViewsYet, + style: Theme.of(context).textTheme.bodySmall, + ).paddedOnly( + left: 16, + right: 16, + ), + TextButton.icon( + onPressed: () { + Scaffold.of(context).closeDrawer(); + const CreateSavedViewRoute(showInSidebar: true) + .push(context); + }, + icon: Icon(Icons.add), + label: Text(S.of(context)!.newView), + ), + ], + ); } return Expanded( child: ListView.builder( diff --git a/lib/features/documents/view/widgets/saved_views/saved_views_widget.dart b/lib/features/documents/view/widgets/saved_views/saved_views_widget.dart index 59590a3..4bb1617 100644 --- a/lib/features/documents/view/widgets/saved_views/saved_views_widget.dart +++ b/lib/features/documents/view/widgets/saved_views/saved_views_widget.dart @@ -127,8 +127,10 @@ class _SavedViewsWidgetState extends State .maybeMap( loaded: (value) { if (value.savedViews.isEmpty) { - return Text(S.of(context)!.youDidNotSaveAnyViewsYet) - .paddedOnly(left: 16); + return Text( + S.of(context)!.youDidNotSaveAnyViewsYet, + style: Theme.of(context).textTheme.bodySmall, + ).paddedOnly(left: 16); } return SizedBox( @@ -173,8 +175,9 @@ class _SavedViewsWidgetState extends State ), ); }, - error: (_) => Text(S.of(context)!.couldNotLoadSavedViews) - .paddedOnly(left: 16), + error: (_) => Text( + S.of(context)!.couldNotLoadSavedViews, + ).paddedOnly(left: 16), orElse: _buildLoadingState, ) .paddedOnly(top: 16), diff --git a/lib/features/landing/view/landing_page.dart b/lib/features/landing/view/landing_page.dart index f127ca4..0b494a8 100644 --- a/lib/features/landing/view/landing_page.dart +++ b/lib/features/landing/view/landing_page.dart @@ -85,8 +85,10 @@ class _LandingPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(S.of(context)!.noSavedViewOnHomepageHint) - .padded(), + Text( + S.of(context)!.youDidNotSaveAnyViewsYet, + style: Theme.of(context).textTheme.bodySmall, + ).padded(), TextButton.icon( onPressed: () { const CreateSavedViewRoute( diff --git a/lib/l10n/intl_ca.arb b/lib/l10n/intl_ca.arb index 3491bbf..bb1bd55 100644 --- a/lib/l10n/intl_ca.arb +++ b/lib/l10n/intl_ca.arb @@ -873,7 +873,7 @@ "@donate": { "description": "Label of the in-app donate button" }, - "donationDialogContent": "Thank you for considering to support this app! Due to both Google's and Apple's Payment Policies, no links leading to donations may be displayed in-app. Not even linking to the project's repository page appears to be allowed in this context. Therefore, maybe have a look at the 'Donations' section in the project's README. Your support is much appreciated and keeps the development of this app alive. Thanks!", + "donationDialogContent": "Gràcies per considerar donar suport a aquesta aplicació! A causa de les polítiques de pagament de Google i d'Apple, no es pot mostrar cap enllaç a les donacions a l'aplicació. Ni tan sols l'enllaç a la pàgina del repositori del projecte sembla que estigui permès en aquest context. Per tant, potser feu una ullada a la secció 'Donacions' del README del projecte. El vostre suport és molt apreciat i manté viu el desenvolupament d'aquesta aplicació. Gràcies!", "@donationDialogContent": { "description": "Text displayed in the donation dialog" }, @@ -897,44 +897,44 @@ "@couldNotDeleteStoragePath": { "description": "Message shown when a storage path could not be deleted" }, - "couldNotUpdateCorrespondent": "Could not update correspondent, please try again.", + "couldNotUpdateCorrespondent": "No es pot actualitzar corresponsal, prova de nou.", "@couldNotUpdateCorrespondent": { "description": "Message shown when a correspondent could not be updated" }, - "couldNotUpdateDocumentType": "Could not update document type, please try again.", + "couldNotUpdateDocumentType": "No es pot actualitzar tipus de document, prova de nou.", "@couldNotUpdateDocumentType": { "description": "Message shown when a document type could not be updated" }, - "couldNotUpdateTag": "Could not update tag, please try again.", + "couldNotUpdateTag": "No es pot actualitzar etiqueta, prova de nou.", "@couldNotUpdateTag": { "description": "Message shown when a tag could not be updated" }, - "couldNotLoadServerInformation": "Could not load server information.", + "couldNotLoadServerInformation": "No es pot carregar informació del servidor.", "@couldNotLoadServerInformation": { "description": "Message shown when the server information could not be loaded" }, - "couldNotLoadStatistics": "Could not load server statistics.", + "couldNotLoadStatistics": "No es poden carregar estadístiques del servidor.", "@couldNotLoadStatistics": { "description": "Message shown when the server statistics could not be loaded" }, - "couldNotLoadUISettings": "Could not load UI settings.", + "couldNotLoadUISettings": "No es pot carregar l'interfície.", "@couldNotLoadUISettings": { "description": "Message shown when the UI settings could not be loaded" }, - "couldNotLoadTasks": "Could not load tasks.", + "couldNotLoadTasks": "No es poden carregar les tasques.", "@couldNotLoadTasks": { "description": "Message shown when the tasks (e.g. document consumed) could not be loaded" }, - "userNotFound": "User could not be found.", + "userNotFound": "Usuari no trobat.", "@userNotFound": { "description": "Message shown when the specified user (e.g. by id) could not be found" }, - "couldNotUpdateSavedView": "Could not update saved view, please try again.", + "couldNotUpdateSavedView": "No es poden acualitzar les vistes desades, prova de nou.", "@couldNotUpdateSavedView": { "description": "Message shown when a saved view could not be updated" }, - "couldNotUpdateStoragePath": "Could not update storage path, please try again.", - "savedViewSuccessfullyUpdated": "Saved view successfully updated.", + "couldNotUpdateStoragePath": "No es pot actualitzar la ruta emmagatzematge, prova de nou.", + "savedViewSuccessfullyUpdated": "Vista desada actualitzada correctament.", "@savedViewSuccessfullyUpdated": { "description": "Message shown when a saved view was successfully updated." }, @@ -942,11 +942,11 @@ "@discardChanges": { "description": "Title of the alert dialog shown when a user tries to close a view with unsaved changes." }, - "savedViewChangedDialogContent": "The filter conditions of the active view have changed. By resetting the filter, these changes will be lost. Do you still wish to continue?", + "savedViewChangedDialogContent": "Les condicions del filtre de la vista activa han canviat. En restablir el filtre, aquests canvis es perdran. Encara vols continuar?", "@savedViewChangedDialogContent": { "description": "Content of the alert dialog shown when all of the following applies:\r\n* User has saved view selected\r\n* User has performed changes to the current document filter\r\n* User now tries to reset this filter without having saved the changes to the view." }, - "createFromCurrentFilter": "Create from current filter", + "createFromCurrentFilter": "Crear desde filtre actual", "@createFromCurrentFilter": { "description": "Tooltip of the \"New saved view\" button" }, @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure a saved view to be displayed on your home page and it will show up here.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Estadí­stiques", "documentsInInbox": "Document safata", "totalDocuments": "Total documents", @@ -974,26 +970,26 @@ "@userAlreadyExists": { "description": "Error message shown when the user tries to add an already existing account." }, - "youDidNotSaveAnyViewsYet": "You did not save any views yet, create one and it will be shown here.", + "youDidNotSaveAnyViewsYet": "Encara no has desat cap visualització, crea'n una i es mostrarà aquí.", "@youDidNotSaveAnyViewsYet": { "description": "Message shown when there are no saved views yet." }, - "tryAgain": "Try again", - "discardFile": "Discard file?", - "discard": "Discard", - "backToLogin": "Back to login", - "skipEditingReceivedFiles": "Skip editing received files", - "uploadWithoutPromptingUploadForm": "Always upload without prompting the upload form when sharing files with the app.", - "authenticatingDots": "Authenticating...", + "tryAgain": "Torna a provar", + "discardFile": "Desestimar arxiu?", + "discard": "Descarta", + "backToLogin": "Torna a inici de sessió", + "skipEditingReceivedFiles": "Salta l'edició de fitxers rebuts", + "uploadWithoutPromptingUploadForm": "Pengeu sempre sense demanar el formulari de càrrega quan compartiu fitxers amb l'aplicació.", + "authenticatingDots": "Autenticant…", "@authenticatingDots": { "description": "Message shown when the app is authenticating the user" }, - "persistingUserInformation": "Persisting user information...", - "fetchingUserInformation": "Fetching user information...", + "persistingUserInformation": "Informació de l'usuari persistent...", + "fetchingUserInformation": "Obtenint dades d'usuari...", "@fetchingUserInformation": { "description": "Message shown when the app loads user data from the server" }, - "restoringSession": "Restoring session...", + "restoringSession": "Restaurant sessió...", "@restoringSession": { "description": "Message shown when the user opens the app and the previous user is tried to be authenticated and logged in" }, @@ -1001,7 +997,7 @@ "@documentsAssigned": { "description": "Text shown with a correspondent, document type etc. to indicate the number of documents this filter will maximally yield." }, - "discardChangesWarning": "You have unsaved changes. By continuing, all changes will be lost. Do you want to discard these changes?", + "discardChangesWarning": "Tens canvis sense desar. Si continues es perdran. Vols descartar els canvis?", "@discardChangesWarning": { "description": "Warning message shown when the user tries to close a route without saving the changes." } diff --git a/lib/l10n/intl_cs.arb b/lib/l10n/intl_cs.arb index 1189722..86c3bdb 100644 --- a/lib/l10n/intl_cs.arb +++ b/lib/l10n/intl_cs.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure a saved view to be displayed on your home page and it will show up here.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Statistics", "documentsInInbox": "Documents in inbox", "totalDocuments": "Total documents", diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index b6c45a2..05b20be 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Konfiguriere eine Ansicht so, dass sie auf deiner Startseite angezeigt wird und sie wird hier erscheinen.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Statistiken", "documentsInInbox": "Dokumente im Posteingang", "totalDocuments": "Dokumente insgesamt", diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index bcee327..e00aaf8 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure a saved view to be displayed on your home page and it will show up here.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Statistics", "documentsInInbox": "Documents in inbox", "totalDocuments": "Total documents", diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index cfa5fc0..f118d0a 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure una vista guardada para que sea mostrada en su página de inicio y aparecerá aquí.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Estadísticas", "documentsInInbox": "Documentos en el buzón", "totalDocuments": "Total de documentos", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index b5ff5bf..3916fc9 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure a saved view to be displayed on your home page and it will show up here.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Statistics", "documentsInInbox": "Documents in inbox", "totalDocuments": "Total documents", diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb index a3f0e82..7e9205e 100644 --- a/lib/l10n/intl_pl.arb +++ b/lib/l10n/intl_pl.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure a saved view to be displayed on your home page and it will show up here.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Statistics", "documentsInInbox": "Documents in inbox", "totalDocuments": "Total documents", diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index 789ef83..dbadfe6 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Настройте сохраненный вид для отображения на вашей домашней страница и он будет отображаться здесь.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Статистика", "documentsInInbox": "Документы во входящих", "totalDocuments": "Всего документов", diff --git a/lib/l10n/intl_tr.arb b/lib/l10n/intl_tr.arb index a61c670..509aad7 100644 --- a/lib/l10n/intl_tr.arb +++ b/lib/l10n/intl_tr.arb @@ -958,10 +958,6 @@ "@welcomeUser": { "description": "Top message shown on the home page" }, - "noSavedViewOnHomepageHint": "Configure a saved view to be displayed on your home page and it will show up here.", - "@noSavedViewOnHomepageHint": { - "description": "Message shown when there is no saved view to display on the home page." - }, "statistics": "Statistics", "documentsInInbox": "Documents in inbox", "totalDocuments": "Total documents",