From f94430b2022bdd021f834c433c9f01cdc902cbcf Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Fri, 27 Jan 2023 12:32:03 +0100 Subject: [PATCH 1/5] Changing new messages separator text --- .../lib/src/localization/translations.dart | 9 ++------- .../src/message_list_view/unread_messages_separator.dart | 4 +--- .../example/lib/add_new_lang.dart | 7 +------ .../lib/src/stream_chat_localizations_ca.dart | 7 +------ .../lib/src/stream_chat_localizations_de.dart | 9 ++------- .../lib/src/stream_chat_localizations_en.dart | 7 +------ .../lib/src/stream_chat_localizations_es.dart | 7 +------ .../lib/src/stream_chat_localizations_fr.dart | 7 +------ .../lib/src/stream_chat_localizations_hi.dart | 7 +------ .../lib/src/stream_chat_localizations_it.dart | 7 +------ .../lib/src/stream_chat_localizations_ja.dart | 7 +------ .../lib/src/stream_chat_localizations_ko.dart | 7 +------ .../lib/src/stream_chat_localizations_no.dart | 7 +------ .../lib/src/stream_chat_localizations_pt.dart | 7 +------ .../test/translations_test.dart | 2 +- 15 files changed, 17 insertions(+), 84 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/localization/translations.dart b/packages/stream_chat_flutter/lib/src/localization/translations.dart index b7436d4b..ac7f8573 100644 --- a/packages/stream_chat_flutter/lib/src/localization/translations.dart +++ b/packages/stream_chat_flutter/lib/src/localization/translations.dart @@ -81,7 +81,7 @@ abstract class Translations { /// The text for showing the unread messages count /// in the [StreamMessageListView] - String unreadMessagesSeparatorText(int unreadCount); + String unreadMessagesSeparatorText(); /// The label for "connected" in [StreamConnectionStatusBuilder] String get connectedLabel; @@ -797,12 +797,7 @@ Attachment limit exceeded: it's not possible to add more than $limit attachments String get linkDisabledError => 'Links are disabled'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 unread message'; - } - return '$unreadCount unread messages'; - } + String unreadMessagesSeparatorText() => 'New messages'; @override String get enableFileAccessMessage => 'Please enable access to files' diff --git a/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart b/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart index 5449cdc9..b32c36d8 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart @@ -24,9 +24,7 @@ class UnreadMessagesSeparator extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8), child: Text( - context.translations.unreadMessagesSeparatorText( - unreadCount, - ), + context.translations.unreadMessagesSeparatorText(), textAlign: TextAlign.center, style: StreamChannelHeaderTheme.of(context).subtitleStyle, ), 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 f71d4e1b..0bb3a217 100644 --- a/packages/stream_chat_localizations/example/lib/add_new_lang.dart +++ b/packages/stream_chat_localizations/example/lib/add_new_lang.dart @@ -459,12 +459,7 @@ class NnStreamChatLocalizations extends GlobalStreamChatLocalizations { String get viewLibrary => 'View library'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 unread message'; - } - return '$unreadCount unread messages'; - } + String unreadMessagesSeparatorText() => 'New messages'; @override String get enableFileAccessMessage => 'Enable file access to continue'; 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 58970090..1b36e4de 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 @@ -438,12 +438,7 @@ class StreamChatLocalizationsCa extends GlobalStreamChatLocalizations { String get linkDisabledError => 'Els enllaços estan deshabilitats'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 missatge no llegit'; - } - return '$unreadCount missatges no llegits'; - } + String unreadMessagesSeparatorText() => 'Missatges nous'; @override String get enableFileAccessMessage => "Habilita l'accés als fitxers" 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 88d7c596..336714ee 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 keine Foto oder Video'; + String get noPhotoOrVideoLabel => 'Es gibt kein Foto oder Video'; @override String get retryLabel => 'Erneut versuchen'; @@ -431,12 +431,7 @@ class StreamChatLocalizationsDe extends GlobalStreamChatLocalizations { String get viewLibrary => 'Bibliothek öffnen'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 ungelesene Nachricht'; - } - return '$unreadCount ungelesene Nachrichten'; - } + String unreadMessagesSeparatorText() => 'Neue Nachrichten'; @override String get enableFileAccessMessage => 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 70bab06d..a90246f2 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 @@ -435,12 +435,7 @@ class StreamChatLocalizationsEn extends GlobalStreamChatLocalizations { String get viewLibrary => 'View library'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 unread message'; - } - return '$unreadCount unread messages'; - } + String unreadMessagesSeparatorText() => 'New messages'; @override String get enableFileAccessMessage => 'Please enable access to files' 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 1e77071e..73df2c5c 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 @@ -440,12 +440,7 @@ No es posible añadir más de $limit archivos adjuntos String get linkDisabledError => 'Los enlaces están deshabilitados'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 mensaje no leído'; - } - return '$unreadCount mensajes no leídos'; - } + String unreadMessagesSeparatorText() => 'Nuevos mensajes'; @override String get enableFileAccessMessage => 'Habilite el acceso a los archivos' 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 75f5cd4f..3b58b794 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 @@ -439,12 +439,7 @@ Limite de pièces jointes dépassée : il n'est pas possible d'ajouter plus de $ String get linkDisabledError => 'Les liens sont désactivés'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 message non lu'; - } - return '$unreadCount messages non lus'; - } + String unreadMessagesSeparatorText() => "Nouveaux messages"; @override String get enableFileAccessMessage => 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 c00ab269..f27172c2 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 @@ -433,12 +433,7 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { String get linkDisabledError => 'लिंक भेजना प्रतिबंधित'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 अपठित संदेश'; - } - return '$unreadCount अपठित संदेश'; - } + String unreadMessagesSeparatorText() => 'नए संदेश।'; @override String get enableFileAccessMessage => 'कृपया फ़ाइलों तक पहुंच सक्षम करें ताकि' 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 b79e2a6d..bebb58e9 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 @@ -442,12 +442,7 @@ Attenzione: il limite massimo di $limit file è stato superato. String get linkDisabledError => 'I links sono disattivati'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 messaggio non letto'; - } - return '$unreadCount messaggi non letti'; - } + String unreadMessagesSeparatorText() => "Nouveaux messages"; @override String get enableFileAccessMessage => "Per favore attiva l'accesso ai file" 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 f26d8f85..8aa070e5 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 @@ -418,12 +418,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get linkDisabledError => 'リンクが無効になっています'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '未読メッセージ1通'; - } - return '$unreadCountつの未読メッセージ'; - } + String unreadMessagesSeparatorText() => '新しいメッセージ。'; @override String get enableFileAccessMessage => 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 7dac84a5..a3490367 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 @@ -419,12 +419,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get linkDisabledError => '링크가 비활성화되었습니다.'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '읽지 않은 메시지 1개'; - } - return '읽지 않은 메시지 $unreadCount개'; - } + String unreadMessagesSeparatorText() => '새 메시지.'; @override String get enableFileAccessMessage => '친구와 공유할 수 있도록 파일에 대한 액세스를 허용하세요.'; 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 4a18fd6b..b2fdd498 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 @@ -383,12 +383,7 @@ class StreamChatLocalizationsNo extends GlobalStreamChatLocalizations { String get viewLibrary => 'Se bibliotek'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 ulest melding'; - } - return '$unreadCount uleste meldinger'; - } + String unreadMessagesSeparatorText() => 'Nye meldinger.'; @override String get couldNotReadBytesFromFileError => 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 3613e91c..aa5fc3f3 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 @@ -438,12 +438,7 @@ Não é possível adicionar mais de $limit arquivos de uma vez String get viewLibrary => 'Ver biblioteca'; @override - String unreadMessagesSeparatorText(int unreadCount) { - if (unreadCount == 1) { - return '1 mensagem não lida'; - } - return '$unreadCount mensagens não lidas'; - } + String unreadMessagesSeparatorText() => "Novas mensagens"; @override String get enableFileAccessMessage => diff --git a/packages/stream_chat_localizations/test/translations_test.dart b/packages/stream_chat_localizations/test/translations_test.dart index 4004994a..02c36dfc 100644 --- a/packages/stream_chat_localizations/test/translations_test.dart +++ b/packages/stream_chat_localizations/test/translations_test.dart @@ -195,7 +195,7 @@ void main() { localizations.toggleMuteUnmuteUserQuestion(isMuted: true), isNotNull); expect(localizations.toggleMuteUnmuteUserText(isMuted: true), isNotNull); expect(localizations.viewLibrary, isNotNull); - expect(localizations.unreadMessagesSeparatorText(2), isNotNull); + expect(localizations.unreadMessagesSeparatorText(), isNotNull); expect(localizations.enableFileAccessMessage, isNotNull); expect(localizations.allowFileAccessMessage, isNotNull); }); From e4b9ec34c011661edff9b94f79a69451bf66e542 Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Fri, 27 Jan 2023 13:31:13 +0100 Subject: [PATCH 2/5] Only deprecating unreadCount, but not deleting it --- .../lib/src/localization/translations.dart | 7 +++++-- .../src/message_list_view/unread_messages_separator.dart | 2 +- .../example/lib/add_new_lang.dart | 2 +- .../lib/src/stream_chat_localizations_ca.dart | 2 +- .../lib/src/stream_chat_localizations_de.dart | 2 +- .../lib/src/stream_chat_localizations_en.dart | 2 +- .../lib/src/stream_chat_localizations_es.dart | 2 +- .../lib/src/stream_chat_localizations_fr.dart | 2 +- .../lib/src/stream_chat_localizations_hi.dart | 2 +- .../lib/src/stream_chat_localizations_it.dart | 2 +- .../lib/src/stream_chat_localizations_ja.dart | 2 +- .../lib/src/stream_chat_localizations_ko.dart | 2 +- .../lib/src/stream_chat_localizations_no.dart | 2 +- .../lib/src/stream_chat_localizations_pt.dart | 2 +- 14 files changed, 18 insertions(+), 15 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/localization/translations.dart b/packages/stream_chat_flutter/lib/src/localization/translations.dart index ac7f8573..71254e73 100644 --- a/packages/stream_chat_flutter/lib/src/localization/translations.dart +++ b/packages/stream_chat_flutter/lib/src/localization/translations.dart @@ -81,7 +81,10 @@ abstract class Translations { /// The text for showing the unread messages count /// in the [StreamMessageListView] - String unreadMessagesSeparatorText(); + String unreadMessagesSeparatorText( + @Deprecated('unreadCount is not used anymore and will be removed ') + int unreadCount, + ); /// The label for "connected" in [StreamConnectionStatusBuilder] String get connectedLabel; @@ -797,7 +800,7 @@ Attachment limit exceeded: it's not possible to add more than $limit attachments String get linkDisabledError => 'Links are disabled'; @override - String unreadMessagesSeparatorText() => 'New messages'; + String unreadMessagesSeparatorText(int unreadCount) => 'New messages'; @override String get enableFileAccessMessage => 'Please enable access to files' diff --git a/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart b/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart index b32c36d8..57e9257c 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view/unread_messages_separator.dart @@ -24,7 +24,7 @@ class UnreadMessagesSeparator extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8), child: Text( - context.translations.unreadMessagesSeparatorText(), + context.translations.unreadMessagesSeparatorText(unreadCount), textAlign: TextAlign.center, style: StreamChannelHeaderTheme.of(context).subtitleStyle, ), 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 0bb3a217..3f3b5bdb 100644 --- a/packages/stream_chat_localizations/example/lib/add_new_lang.dart +++ b/packages/stream_chat_localizations/example/lib/add_new_lang.dart @@ -459,7 +459,7 @@ class NnStreamChatLocalizations extends GlobalStreamChatLocalizations { String get viewLibrary => 'View library'; @override - String unreadMessagesSeparatorText() => 'New messages'; + String unreadMessagesSeparatorText(int unreadCount) => 'New messages'; @override String get enableFileAccessMessage => 'Enable file access to continue'; 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 1b36e4de..3c471e05 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 @@ -438,7 +438,7 @@ class StreamChatLocalizationsCa extends GlobalStreamChatLocalizations { String get linkDisabledError => 'Els enllaços estan deshabilitats'; @override - String unreadMessagesSeparatorText() => 'Missatges nous'; + String unreadMessagesSeparatorText(int unreadCount) => 'Missatges nous'; @override String get enableFileAccessMessage => "Habilita l'accés als fitxers" 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 336714ee..df2a7766 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 @@ -431,7 +431,7 @@ class StreamChatLocalizationsDe extends GlobalStreamChatLocalizations { String get viewLibrary => 'Bibliothek öffnen'; @override - String unreadMessagesSeparatorText() => 'Neue Nachrichten'; + String unreadMessagesSeparatorText(int unreadCount) => 'Neue Nachrichten'; @override String get enableFileAccessMessage => 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 a90246f2..c55bbf49 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 @@ -435,7 +435,7 @@ class StreamChatLocalizationsEn extends GlobalStreamChatLocalizations { String get viewLibrary => 'View library'; @override - String unreadMessagesSeparatorText() => 'New messages'; + String unreadMessagesSeparatorText(int unreadCount) => 'New messages'; @override String get enableFileAccessMessage => 'Please enable access to files' 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 73df2c5c..107e2616 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 @@ -440,7 +440,7 @@ No es posible añadir más de $limit archivos adjuntos String get linkDisabledError => 'Los enlaces están deshabilitados'; @override - String unreadMessagesSeparatorText() => 'Nuevos mensajes'; + String unreadMessagesSeparatorText(int unreadCount) => 'Nuevos mensajes'; @override String get enableFileAccessMessage => 'Habilite el acceso a los archivos' 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 3b58b794..887b484e 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 @@ -439,7 +439,7 @@ Limite de pièces jointes dépassée : il n'est pas possible d'ajouter plus de $ String get linkDisabledError => 'Les liens sont désactivés'; @override - String unreadMessagesSeparatorText() => "Nouveaux messages"; + String unreadMessagesSeparatorText(int unreadCount) => "Nouveaux messages"; @override String get enableFileAccessMessage => 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 f27172c2..4f27717a 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 @@ -433,7 +433,7 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { String get linkDisabledError => 'लिंक भेजना प्रतिबंधित'; @override - String unreadMessagesSeparatorText() => 'नए संदेश।'; + String unreadMessagesSeparatorText(int unreadCount) => 'नए संदेश।'; @override String get enableFileAccessMessage => 'कृपया फ़ाइलों तक पहुंच सक्षम करें ताकि' 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 bebb58e9..177854a3 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 @@ -442,7 +442,7 @@ Attenzione: il limite massimo di $limit file è stato superato. String get linkDisabledError => 'I links sono disattivati'; @override - String unreadMessagesSeparatorText() => "Nouveaux messages"; + String unreadMessagesSeparatorText(int unreadCount) => "Nouveaux messages"; @override String get enableFileAccessMessage => "Per favore attiva l'accesso ai file" 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 8aa070e5..26a5e8b3 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 @@ -418,7 +418,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get linkDisabledError => 'リンクが無効になっています'; @override - String unreadMessagesSeparatorText() => '新しいメッセージ。'; + String unreadMessagesSeparatorText(int unreadCount) => '新しいメッセージ。'; @override String get enableFileAccessMessage => 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 a3490367..7b907584 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 @@ -419,7 +419,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get linkDisabledError => '링크가 비활성화되었습니다.'; @override - String unreadMessagesSeparatorText() => '새 메시지.'; + String unreadMessagesSeparatorText(int unreadCount) => '새 메시지.'; @override String get enableFileAccessMessage => '친구와 공유할 수 있도록 파일에 대한 액세스를 허용하세요.'; 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 b2fdd498..88350979 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 @@ -383,7 +383,7 @@ class StreamChatLocalizationsNo extends GlobalStreamChatLocalizations { String get viewLibrary => 'Se bibliotek'; @override - String unreadMessagesSeparatorText() => 'Nye meldinger.'; + String unreadMessagesSeparatorText(int unreadCount) => 'Nye meldinger.'; @override String get couldNotReadBytesFromFileError => 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 aa5fc3f3..9464e90d 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 @@ -438,7 +438,7 @@ Não é possível adicionar mais de $limit arquivos de uma vez String get viewLibrary => 'Ver biblioteca'; @override - String unreadMessagesSeparatorText() => "Novas mensagens"; + String unreadMessagesSeparatorText(int unreadCount) => "Novas mensagens"; @override String get enableFileAccessMessage => From 42540ce5fbfa2db3abcf00fdd53bcf74e27a5396 Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Fri, 27 Jan 2023 13:38:36 +0100 Subject: [PATCH 3/5] Update translations_test.dart --- packages/stream_chat_localizations/test/translations_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/test/translations_test.dart b/packages/stream_chat_localizations/test/translations_test.dart index 02c36dfc..4004994a 100644 --- a/packages/stream_chat_localizations/test/translations_test.dart +++ b/packages/stream_chat_localizations/test/translations_test.dart @@ -195,7 +195,7 @@ void main() { localizations.toggleMuteUnmuteUserQuestion(isMuted: true), isNotNull); expect(localizations.toggleMuteUnmuteUserText(isMuted: true), isNotNull); expect(localizations.viewLibrary, isNotNull); - expect(localizations.unreadMessagesSeparatorText(), isNotNull); + expect(localizations.unreadMessagesSeparatorText(2), isNotNull); expect(localizations.enableFileAccessMessage, isNotNull); expect(localizations.allowFileAccessMessage, isNotNull); }); From 91b36fb6f77e2d4e3801ca541c50155148089e13 Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Fri, 27 Jan 2023 13:47:13 +0100 Subject: [PATCH 4/5] Fixing single quotes --- .../lib/src/stream_chat_localizations_fr.dart | 2 +- .../lib/src/stream_chat_localizations_it.dart | 2 +- .../lib/src/stream_chat_localizations_pt.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 887b484e..8b501184 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 @@ -439,7 +439,7 @@ Limite de pièces jointes dépassée : il n'est pas possible d'ajouter plus de $ String get linkDisabledError => 'Les liens sont désactivés'; @override - String unreadMessagesSeparatorText(int unreadCount) => "Nouveaux messages"; + String unreadMessagesSeparatorText(int unreadCount) => 'Nouveaux messages'; @override String get enableFileAccessMessage => 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 177854a3..b407629d 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 @@ -442,7 +442,7 @@ Attenzione: il limite massimo di $limit file è stato superato. String get linkDisabledError => 'I links sono disattivati'; @override - String unreadMessagesSeparatorText(int unreadCount) => "Nouveaux messages"; + String unreadMessagesSeparatorText(int unreadCount) => 'Nouveaux messages'; @override String get enableFileAccessMessage => "Per favore attiva l'accesso ai file" 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 9464e90d..874eb118 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 @@ -438,7 +438,7 @@ Não é possível adicionar mais de $limit arquivos de uma vez String get viewLibrary => 'Ver biblioteca'; @override - String unreadMessagesSeparatorText(int unreadCount) => "Novas mensagens"; + String unreadMessagesSeparatorText(int unreadCount) => 'Novas mensagens'; @override String get enableFileAccessMessage => From 409367a5ad4e2895935a0682a28b024497b22aed Mon Sep 17 00:00:00 2001 From: Leandro Borges Ferreira Date: Fri, 27 Jan 2023 13:52:15 +0100 Subject: [PATCH 5/5] Update CHANGELOG.md --- packages/stream_chat_localizations/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 87947c78..20fd8458 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -4,6 +4,7 @@ * 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 text in New messages separator. Now is doesn't count the new messages and only shows "New messages". All the translations were updated. 🔄 Changed