From dfe82e6e4793257ef04d333fcee6e62c1e8dd136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Adasiewicz?= Date: Thu, 26 Jan 2023 12:43:34 +0100 Subject: [PATCH 1/5] fix(ui,localization): change label displayed when there is no photo or videos to attach --- packages/stream_chat_flutter/CHANGELOG.md | 3 +++ .../lib/src/localization/translations.dart | 6 ++++++ .../src/scroll_view/photo_gallery/stream_photo_gallery.dart | 6 +++--- packages/stream_chat_localizations/CHANGELOG.md | 1 + .../lib/src/stream_chat_localizations_ca.dart | 3 +++ .../lib/src/stream_chat_localizations_de.dart | 3 +++ .../lib/src/stream_chat_localizations_en.dart | 3 +++ .../lib/src/stream_chat_localizations_es.dart | 3 +++ .../lib/src/stream_chat_localizations_fr.dart | 3 +++ .../lib/src/stream_chat_localizations_hi.dart | 3 +++ .../lib/src/stream_chat_localizations_it.dart | 3 +++ .../lib/src/stream_chat_localizations_ja.dart | 3 +++ .../lib/src/stream_chat_localizations_ko.dart | 3 +++ .../lib/src/stream_chat_localizations_no.dart | 3 +++ .../lib/src/stream_chat_localizations_pt.dart | 3 +++ 15 files changed, 46 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index dfb83a73..d9095ce9 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -4,6 +4,9 @@ - [[#1424]](https://github.com/GetStream/stream-chat-flutter/issues/1424) Fixed a render issue when showing messages starting with 4 whitespaces. - Fixed a bug where the `AttachmentPickerBottomSheet` was not able to identify the mobile browser. +✅ Added +- New `noPhotoOrVideoLabel` displayed when there is no files to choose. + ## 5.2.0 ✅ Added diff --git a/packages/stream_chat_flutter/lib/src/localization/translations.dart b/packages/stream_chat_flutter/lib/src/localization/translations.dart index d41dfcb8..b7436d4b 100644 --- a/packages/stream_chat_flutter/lib/src/localization/translations.dart +++ b/packages/stream_chat_flutter/lib/src/localization/translations.dart @@ -18,6 +18,9 @@ abstract class Translations { /// The label for showing no users String get noUsersLabel; + /// The label for showing no photo or video + String get noPhotoOrVideoLabel; + /// The text for showing user is online String get userOnlineText; @@ -373,6 +376,9 @@ class DefaultTranslations implements Translations { @override String get noUsersLabel => 'There are no users currently'; + @override + String get noPhotoOrVideoLabel => 'There is no photo or video'; + @override String get retryLabel => 'Retry'; diff --git a/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery.dart b/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery.dart index 257eae22..8af231a5 100644 --- a/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery.dart +++ b/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery.dart @@ -366,7 +366,7 @@ class StreamPhotoGallery extends StatelessWidget { color: chatThemeData.colorTheme.disabled, ), emptyTitle: Text( - context.translations.noUsersLabel, + context.translations.noPhotoOrVideoLabel, style: chatThemeData.textTheme.headline, ), ), @@ -377,7 +377,7 @@ class StreamPhotoGallery extends StatelessWidget { return StreamScrollViewLoadMoreError.grid( onTap: controller.retry, error: Text( - context.translations.loadingUsersError, + context.translations.genericErrorText, textAlign: TextAlign.center, ), ); @@ -400,7 +400,7 @@ class StreamPhotoGallery extends StatelessWidget { return errorBuilder?.call(context, error) ?? Center( child: StreamScrollViewErrorWidget( - errorTitle: Text(context.translations.loadingUsersError), + errorTitle: Text(context.translations.genericErrorText), onRetryPressed: controller.refresh, ), ); diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 07a266d0..878a73fd 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -3,6 +3,7 @@ ✅ Added * Added support for [Catalan](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart) locale. +* Added translations for new `noPhotoOrVideoLabel` label. 🔄 Changed diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart index 68b6c3cd..d28f7b96 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ca.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsCa extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'Actualment no hi ha usuaris'; + @override + String get noPhotoOrVideoLabel => 'No hi ha fotos ni vídeos'; + @override String get retryLabel => 'Torna-ho a provar'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart index 0c0d5660..a75417b8 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsDe extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'Derzeit gibt es keine User'; + @override + String get noPhotoOrVideoLabel => 'Es gibt kein Foto oder Video'; + @override String get retryLabel => 'Erneut versuchen'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart index 34cf5fef..70bab06d 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsEn extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'There are no users currently'; + @override + String get noPhotoOrVideoLabel => 'There is no photo or video'; + @override String get retryLabel => 'Retry'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart index 40f7d52f..1e77071e 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'No hay usuarios actualmente'; + @override + String get noPhotoOrVideoLabel => 'No hay fotos ni vídeos'; + @override String get retryLabel => 'Inténtelo de nuevo'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart index 16834958..75f5cd4f 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { @override String get noUsersLabel => "Il n'y a pas d'utilisateurs actuellement"; + @override + String get noPhotoOrVideoLabel => "Il n'y a ni photo ni vidéo"; + @override String get retryLabel => 'Réessayer'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart index 0887f57f..4963c5b6 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'वर्तमान में कोई यूजर नहीं हैं'; + @override + String get noPhotoOrVideoLabel => "कोई फोटो या वीडियो नहीं है।"; + @override String get retryLabel => 'पुन: प्रयास करे'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart index 3e5d7d62..b79e2a6d 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsIt extends GlobalStreamChatLocalizations { @override String get noUsersLabel => "Non c'é nessun utente al momento"; + @override + String get noPhotoOrVideoLabel => 'Non ci sono foto o video'; + @override String get retryLabel => 'Riprova'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart index b6384d4b..f26d8f85 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { @override String get noUsersLabel => '現在、ユーザーはいません。'; + @override + String get noPhotoOrVideoLabel => '写真やビデオはありません'; + @override String get retryLabel => '再試行'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart index b1b929a4..7dac84a5 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { @override String get noUsersLabel => '현재 사용자가 없습니다'; + @override + String get noPhotoOrVideoLabel => '사진이나 동영상이 없습니다'; + @override String get retryLabel => '다시 시도하십시오'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart index db231a86..4a18fd6b 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_no.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsNo extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'Det er ingen brukere akkurat nå'; + @override + String get noPhotoOrVideoLabel => 'Det er ingen bilde eller video'; + @override String get retryLabel => 'Prøv igjen'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart index 254a3d5e..7dd4cd7f 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart @@ -14,6 +14,9 @@ class StreamChatLocalizationsPt extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'Nenhum usuário atualmente'; + @override + String get noPhotoOrVideoLabel => 'Não há foto ou vídeo'; + @override String get retryLabel => 'Tente novamente'; From 61d85340de71ed9c5e3c65e4466982a9de8f28e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Adasiewicz?= Date: Thu, 26 Jan 2023 14:09:26 +0100 Subject: [PATCH 2/5] Fix analyze --- .../stream_chat_localizations/example/lib/add_new_lang.dart | 3 +++ .../lib/src/stream_chat_localizations_hi.dart | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/example/lib/add_new_lang.dart b/packages/stream_chat_localizations/example/lib/add_new_lang.dart index c52761a8..f71d4e1b 100644 --- a/packages/stream_chat_localizations/example/lib/add_new_lang.dart +++ b/packages/stream_chat_localizations/example/lib/add_new_lang.dart @@ -38,6 +38,9 @@ class NnStreamChatLocalizations extends GlobalStreamChatLocalizations { @override String get noUsersLabel => 'There are no users currently'; + @override + String get noPhotoOrVideoLabel => 'There is no photo or video'; + @override String get retryLabel => 'Retry'; diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart index 4963c5b6..c00ab269 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart @@ -15,7 +15,7 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { String get noUsersLabel => 'वर्तमान में कोई यूजर नहीं हैं'; @override - String get noPhotoOrVideoLabel => "कोई फोटो या वीडियो नहीं है।"; + String get noPhotoOrVideoLabel => 'कोई फोटो या वीडियो नहीं है।'; @override String get retryLabel => 'पुन: प्रयास करे'; From 8d6336ee7d2687d6e4fb88de48bc1ae5f4b8bb22 Mon Sep 17 00:00:00 2001 From: Rafal Adasiewicz Date: Thu, 26 Jan 2023 14:11:26 +0100 Subject: [PATCH 3/5] Update packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart Co-authored-by: Leandro Borges Ferreira --- .../lib/src/stream_chat_localizations_pt.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart index 7dd4cd7f..4550c2df 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart @@ -15,7 +15,7 @@ class StreamChatLocalizationsPt extends GlobalStreamChatLocalizations { String get noUsersLabel => 'Nenhum usuário atualmente'; @override - String get noPhotoOrVideoLabel => 'Não há foto ou vídeo'; + String get noPhotoOrVideoLabel => 'Não há fotos ou vídeos'; @override String get retryLabel => 'Tente novamente'; From 95070125ef1e1059821e8fad43ea0cea6333ff25 Mon Sep 17 00:00:00 2001 From: Rafal Adasiewicz Date: Thu, 26 Jan 2023 14:11:32 +0100 Subject: [PATCH 4/5] Update packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart Co-authored-by: Leandro Borges Ferreira --- .../lib/src/stream_chat_localizations_de.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart index a75417b8..88d7c596 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart @@ -15,7 +15,7 @@ class StreamChatLocalizationsDe extends GlobalStreamChatLocalizations { String get noUsersLabel => 'Derzeit gibt es keine User'; @override - String get noPhotoOrVideoLabel => 'Es gibt kein Foto oder Video'; + String get noPhotoOrVideoLabel => 'Es gibt keine Foto oder Video'; @override String get retryLabel => 'Erneut versuchen'; From 58f6ea9370dfaea145e63f90ed501f54b5d49484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Adasiewicz?= Date: Thu, 26 Jan 2023 15:30:49 +0100 Subject: [PATCH 5/5] fix formatting --- .../lib/src/stream_chat_localizations_pt.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart index 90535b9e..3613e91c 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_pt.dart @@ -69,7 +69,8 @@ class StreamChatLocalizationsPt extends GlobalStreamChatLocalizations { String get genericErrorText => 'Ocorreu um problema'; @override - String get loadingMessagesError => 'Ocorreu um problema ao carregar a mensagem'; + String get loadingMessagesError => + 'Ocorreu um problema ao carregar a mensagem'; @override String resultCountText(int count) => '$count resultados';