From e14258c3906554b659ad73439f27b9273308ad16 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 15:19:12 -0400 Subject: [PATCH 01/32] feat: support for japanese --- .../lib/src/stream_chat_localizations.dart | 5 + .../lib/src/stream_chat_localizations_ja.dart | 360 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart index a6a66b93..e65aab1f 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart @@ -11,6 +11,8 @@ part 'stream_chat_localizations_fr.dart'; part 'stream_chat_localizations_it.dart'; +part 'stream_chat_localizations_ja.dart'; + part 'stream_chat_localizations_hi.dart'; /// The set of supported languages, as language code strings. @@ -27,6 +29,7 @@ const kStreamChatSupportedLanguages = { 'fr', 'it', 'es', + 'ja', }; /// Creates a [GlobalStreamChatLocalizations] instance for the given `locale`. @@ -59,6 +62,8 @@ GlobalStreamChatLocalizations? getStreamChatTranslation(Locale locale) { return const StreamChatLocalizationsIt(); case 'es': return const StreamChatLocalizationsEs(); + case 'ja': + return const StreamChatLocalizationsJa(); } } 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 new file mode 100644 index 00000000..96ffec25 --- /dev/null +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart @@ -0,0 +1,360 @@ +part of 'stream_chat_localizations.dart'; + +/// The translations for English (`ja`). +class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { + /// Create an instance of the translation bundle for Japanese. + const StreamChatLocalizationsJa({String localeName = 'ja'}) + : super(localeName: localeName); + + @override + String get launchUrlError => 'ユーアーレルの起動ができない'; + + @override + String get loadingUsersError => 'ユーザーの読み込みエラー'; + + @override + String get noUsersLabel => '現在、ユーザーはいません。'; + + @override + String get retryLabel => '再試行'; + + @override + String get userLastOnlineText => '前回のオンライン'; + + @override + String get userOnlineText => 'オンライン'; + + @override + String userTypingText(Iterable users) { + if (users.isEmpty) return ''; + final first = users.first; + if (users.length == 1) { + return '${first.name}がタイプしている'; + } + return '${first.name}とあと${users.length - 1}人が入力しています'; + } + + @override + String get threadReplyLabel => 'スレッド返信'; + + @override + String get onlyVisibleToYouText => '自分にしか見えない'; + + @override + String threadReplyCountText(int count) => '$countスレッドの返信'; + + @override + String attachmentsUploadProgressText({ + required int remaining, + required int total, + }) => + '$remaining/${total}mbのアップロード 。。。'; + + @override + String pinnedByUserText({ + required User pinnedBy, + required User currentUser, + }) { + final pinnedByCurrentUser = currentUser.id == pinnedBy.id; + if (pinnedByCurrentUser) return 'あなたのピン留'; + return '${pinnedBy.name}のピン留'; + } + + @override + String get emptyMessagesText => '現在、メッセージはありません。'; + + @override + String get genericErrorText => '何かが間違っていた'; + + @override + String get loadingMessagesError => 'メッセージの読み込みエラー'; + + @override + String resultCountText(int count) => '$countつの結果'; + + @override + String get messageDeletedText => 'このメッセージは削除されました。'; + + @override + String get messageDeletedLabel => 'メッセージ削除'; + + @override + String get messageReactionsLabel => 'メッセージに対する反応'; + + @override + String get emptyChatMessagesText => 'ここではまだ会話はありませんが。。。'; + + @override + String threadSeparatorText(int replyCount) { + if (replyCount == 1) return '1 回答'; + return '$replyCount件の返信'; + } + + @override + String get connectedLabel => 'コネクテッド'; + + @override + String get disconnectedLabel => '接続切れ'; + + @override + String get reconnectingLabel => 'リコネクティング。。。'; + + @override + String get alsoSendAsDirectMessageLabel => 'ダイレクトメッセージでも送信可能'; + + @override + String get addACommentOrSendLabel => 'コメントの追加や送信'; + + @override + String get searchGifLabel => '検索用GIF'; + + @override + String get writeAMessageLabel => 'メッセージを書く'; + + @override + String get instantCommandsLabel => 'インスタントコマンド'; + + @override + String fileTooLargeAfterCompressionError(double limitInMB) => + 'ファイルのサイズが大きすぎてアップロードできません。' + 'ファイルサイズの制限は${limitInMB}MBです。' + '圧縮してみましたが、十分ではありませんでした。'; + + @override + String fileTooLargeError(double limitInMB) => + 'ファイルが大きすぎてアップロードできません。ファイルサイズの制限は${limitInMB}MBです。'; + + @override + String emojiMatchingQueryText(String query) => '「"$query"」とお揃いの絵文字'; + + @override + String get addAFileLabel => 'ファイルの追加'; + + @override + String get photoFromCameraLabel => 'カメラからの写真'; + + @override + String get uploadAFileLabel => 'ファイルのアップロード'; + + @override + String get uploadAPhotoLabel => '写真のアップロード'; + + @override + String get uploadAVideoLabel => '動画のアップロード'; + + @override + String get videoFromCameraLabel => 'カメラからの動画'; + + @override + String get okLabel => 'よし'; + + @override + String get somethingWentWrongError => '何かが間違っていたのだ。'; + + @override + String get addMoreFilesLabel => 'ファイルの追加'; + + @override + String get enablePhotoAndVideoAccessMessage => 'お友達と共有できるように、写真' + '\nやビデオへのアクセスを有効にしてください。'; + @override + String get allowGalleryAccessMessage => 'お客様のギャラリーへのアクセスを許可する'; + + @override + String get flagMessageLabel => 'メッセージフラグが'; + + @override + String get flagMessageQuestion => 'このメッセージのコピーを' + '\nモデレーターに送って、さらに調査してもらいますか?'; + + @override + String get flagLabel => 'フラグが'; + + @override + String get cancelLabel => 'キャンセル'; + + @override + String get flagMessageSuccessfulLabel => 'フラグ付メッセージ'; + + @override + String get flagMessageSuccessfulText => + 'このメッセージはモデレーターに報告されました。'; + + @override + String get deleteLabel => '消す'; + + @override + String get deleteMessageLabel => 'メッセージを削除する '; + + @override + String get deleteMessageQuestion => + 'このメッセージ' + '\nを完全に削除してもよろしいですか?'; + + @override + String get operationCouldNotBeCompletedText => + '操作を完了できませんでした。'; + + @override + String get replyLabel => '返信'; + + @override + String togglePinUnpinText({required bool pinned}) { + if (pinned) return 'カンバセーションからピンを外す '; + return '会話へのピン'; + } + + @override + String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) { + if (isDeleteFailed) return 'メッセージの削除を再試行してください'; + return 'メッセージを削除する'; + } + + @override + String get copyMessageLabel => 'コピーメッセージ'; + + @override + String get editMessageLabel => 'メッセージの編集'; + + @override + String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) { + if (isUpdateFailed) return '編集したメッセージの再送'; + return '再送'; + } + + @override + String get photosLabel => '写真'; + + String _getDay(DateTime dateTime) { + final now = DateTime.now(); + final today = DateTime(now.year, now.month, now.day); + final yesterday = DateTime(now.year, now.month, now.day - 1); + + final date = DateTime(dateTime.year, dateTime.month, dateTime.day); + + if (date == today) { + return '今日'; + } else if (date == yesterday) { + return '昨日'; + } else { + return '${Jiffy(date).MMMd}に'; + } + } + + @override + String sentAtText({required DateTime date, required DateTime time}) => + '${_getDay(date)} at ${Jiffy(time.toLocal()).format('HH:mm')}に送信 '; + + @override + String get todayLabel => '今日'; + + @override + String get yesterdayLabel => '昨日'; + + @override + String get channelIsMutedText => 'チャンネルがミュートされています'; + + @override + String get noTitleText => 'タイトル無し'; + + @override + String get letsStartChattingLabel => 'さあ、チャットを始めよう'; + + @override + String get sendingFirstMessageLabel => + 'どのように友人にあなたの最初のメッセージを送ることについてはどうですか?'; + + @override + String get startAChatLabel => 'チャットを開始する'; + + @override + String get loadingChannelsError => 'チャネルのロード中にエラーが発生しました'; + + @override + String get deleteConversationLabel => '会話を削除する'; + + @override + String get deleteConversationQuestion => + 'この会話を削除してもよろしいですか?'; + + @override + String get streamChatLabel => 'ストリームチャット'; + + @override + String get searchingForNetworkText => 'ネットワークの検索'; + + @override + String get offlineLabel => 'オフライン。。。'; + + @override + String get tryAgainLabel => '再試行する'; + + @override + String membersCountText(int count) { + if (count == 1) return '1人のメンバー'; + return '$count人のメンバー'; + } + + @override + String watchersCountText(int count) { + if (count == 1) return '1オンライン'; + return '$countオンライン'; + } + + @override + String get viewInfoLabel => '情報を見る'; + + @override + String get leaveGroupLabel => 'グループを離れる'; + + @override + String get leaveLabel => '離れる'; + + @override + String get leaveConversationLabel => '会話を離れる'; + + @override + String get leaveConversationQuestion => + 'この会話を離れてもよろしいですか?'; + + @override + String get showInChatLabel => 'チャットで表示'; + + @override + String get saveImageLabel => '画像を保存'; + + @override + String get saveVideoLabel => 'ビデオを保存'; + + @override + String get uploadErrorLabel => 'アップロードエラー'; + + @override + String get giphyLabel => 'ギフィー'; + + @override + String get shuffleLabel => 'ミックス'; + + @override + String get sendLabel => '送信'; + + @override + String get withText => 'と'; + + @override + String get inText => 'は'; + + @override + String get youText => '君'; + + @override + String get ofText => 'の';//TODO: break + // galleryPaginationText( + // {required int currentPage, required int totalPages}) + + @override + String get fileText => 'ファイル'; + + @override + String get replyToMessageLabel => 'メッセージに返信'; +} From e44a4ce3a1dc88ba89137f4c3baa3fcaabb4d794 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 15:19:55 -0400 Subject: [PATCH 02/32] update fr translation: discussion->conversation --- .../lib/src/stream_chat_localizations_fr.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 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 9d8586d5..373558b9 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 @@ -207,7 +207,7 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { @override String togglePinUnpinText({required bool pinned}) { if (pinned) return 'Décrocher de la conversation'; - return 'Épingler à la discussion'; + return 'Épingler à la conversation'; } @override @@ -354,7 +354,7 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { String get youText => 'Vous'; @override - String get ofText => 'de'; + String galleryPaginationText({required int currentPage, required int totalPages}) => '${currentPage+1} de $totalPages'; @override String get fileText => 'Fichier'; From 59b4f5568c77ccae4b56d919216bd82058050ffb Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 15:30:58 -0400 Subject: [PATCH 03/32] breaking change: ofText->galleryPaginationText --- .../lib/src/gallery_footer.dart | 6 ++--- .../lib/src/localization/translations.dart | 9 ++++--- .../test/src/default_translations_test.dart | 2 +- .../example/lib/add_new_lang.dart | 4 +++- .../lib/src/stream_chat_localizations_en.dart | 4 +++- .../lib/src/stream_chat_localizations_es.dart | 7 ++++-- .../lib/src/stream_chat_localizations_fr.dart | 4 +++- .../lib/src/stream_chat_localizations_hi.dart | 8 ++++--- .../lib/src/stream_chat_localizations_it.dart | 4 +++- .../lib/src/stream_chat_localizations_ja.dart | 24 +++++++------------ .../test/translations_test.dart | 2 +- 11 files changed, 42 insertions(+), 32 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/gallery_footer.dart b/packages/stream_chat_flutter/lib/src/gallery_footer.dart index 03d575ae..6df301d3 100644 --- a/packages/stream_chat_flutter/lib/src/gallery_footer.dart +++ b/packages/stream_chat_flutter/lib/src/gallery_footer.dart @@ -136,9 +136,9 @@ class _GalleryFooterState extends State { mainAxisSize: MainAxisSize.min, children: [ Text( - '${widget.currentPage + 1} ' - '${context.translations.ofText} ' - '${widget.totalPages}', + context.translations.galleryPaginationText( + currentPage: widget.currentPage, + totalPages: widget.totalPages), style: galleryFooterThemeData.titleTextStyle, ), ], diff --git a/packages/stream_chat_flutter/lib/src/localization/translations.dart b/packages/stream_chat_flutter/lib/src/localization/translations.dart index d6e5add0..d3b3e8cb 100644 --- a/packages/stream_chat_flutter/lib/src/localization/translations.dart +++ b/packages/stream_chat_flutter/lib/src/localization/translations.dart @@ -296,8 +296,9 @@ abstract class Translations { /// The text shown for "You" String get youText; - /// The text shown for "Of" - String get ofText; + /// Gallery footer pagination text + String galleryPaginationText( + {required int currentPage, required int totalPages}); /// The text shown for "File" String get fileText; @@ -657,7 +658,9 @@ class DefaultTranslations implements Translations { String get youText => 'You'; @override - String get ofText => 'of'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '${currentPage + 1} of $totalPages'; @override String get fileText => 'File'; diff --git a/packages/stream_chat_flutter/test/src/default_translations_test.dart b/packages/stream_chat_flutter/test/src/default_translations_test.dart index e78c0115..14a4a318 100644 --- a/packages/stream_chat_flutter/test/src/default_translations_test.dart +++ b/packages/stream_chat_flutter/test/src/default_translations_test.dart @@ -167,7 +167,7 @@ void main() { expect(translations.withText, isNotNull); expect(translations.inText, isNotNull); expect(translations.youText, isNotNull); - expect(translations.ofText, isNotNull); + expect(translations.galleryPaginationText, isNotNull); expect(translations.fileText, isNotNull); expect(translations.replyToMessageLabel, isNotNull); }); 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 1412f4e0..2f373691 100644 --- a/packages/stream_chat_localizations/example/lib/add_new_lang.dart +++ b/packages/stream_chat_localizations/example/lib/add_new_lang.dart @@ -374,7 +374,9 @@ class NnStreamChatLocalizations extends GlobalStreamChatLocalizations { String get youText => 'You'; @override - String get ofText => 'of'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '$currentPage of $totalPages'; @override String get fileText => 'File'; 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 5041d398..13de9729 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 @@ -350,7 +350,9 @@ class StreamChatLocalizationsEn extends GlobalStreamChatLocalizations { String get youText => 'You'; @override - String get ofText => 'of'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '${currentPage + 1} of $totalPages'; @override String get fileText => 'File'; 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 75bed1e3..f6cd5e7c 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 @@ -68,7 +68,8 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get genericErrorText => 'Hubo un problema'; @override - String get loadingMessagesError => 'Hubo un error mientras se cargaba el mensaje'; + String get loadingMessagesError => + 'Hubo un error mientras se cargaba el mensaje'; @override String resultCountText(int count) => '$count resultados'; @@ -354,7 +355,9 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get youText => 'Usted'; @override - String get ofText => 'de'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '${currentPage + 1} de $totalPages'; @override String get fileText => 'Archivo'; 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 373558b9..2331b522 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 @@ -354,7 +354,9 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { String get youText => 'Vous'; @override - String galleryPaginationText({required int currentPage, required int totalPages}) => '${currentPage+1} de $totalPages'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '${currentPage + 1} de $totalPages'; @override String get fileText => 'Fichier'; 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 850e481b..11d7d486 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 @@ -340,16 +340,18 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { String get sendLabel => 'भेजें'; @override - String get withText => 'विद'; + String get withText => 'विद';//TODO: break? @override - String get inText => 'इन'; + String get inText => 'इन';//TODO: break? @override String get youText => 'आप'; @override - String get ofText => 'ऑफ़'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '${currentPage + 1} ऑफ़ $totalPages'; @override String get fileText => 'फ़ाइल'; 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 8b2e1692..313e1e26 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 @@ -351,7 +351,9 @@ Il file è troppo grande per essere caricato. Il limite è di $limitInMB MB.'''; String get youText => 'te'; @override - String get ofText => 'di'; + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '${currentPage + 1} di $totalPages'; @override String get fileText => '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 96ffec25..6522fbf7 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 @@ -177,8 +177,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get flagMessageSuccessfulLabel => 'フラグ付メッセージ'; @override - String get flagMessageSuccessfulText => - 'このメッセージはモデレーターに報告されました。'; + String get flagMessageSuccessfulText => 'このメッセージはモデレーターに報告されました。'; @override String get deleteLabel => '消す'; @@ -187,13 +186,11 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get deleteMessageLabel => 'メッセージを削除する '; @override - String get deleteMessageQuestion => - 'このメッセージ' + String get deleteMessageQuestion => 'このメッセージ' '\nを完全に削除してもよろしいですか?'; @override - String get operationCouldNotBeCompletedText => - '操作を完了できませんでした。'; + String get operationCouldNotBeCompletedText => '操作を完了できませんでした。'; @override String get replyLabel => '返信'; @@ -261,8 +258,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get letsStartChattingLabel => 'さあ、チャットを始めよう'; @override - String get sendingFirstMessageLabel => - 'どのように友人にあなたの最初のメッセージを送ることについてはどうですか?'; + String get sendingFirstMessageLabel => 'どのように友人にあなたの最初のメッセージを送ることについてはどうですか?'; @override String get startAChatLabel => 'チャットを開始する'; @@ -274,8 +270,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get deleteConversationLabel => '会話を削除する'; @override - String get deleteConversationQuestion => - 'この会話を削除してもよろしいですか?'; + String get deleteConversationQuestion => 'この会話を削除してもよろしいですか?'; @override String get streamChatLabel => 'ストリームチャット'; @@ -314,8 +309,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get leaveConversationLabel => '会話を離れる'; @override - String get leaveConversationQuestion => - 'この会話を離れてもよろしいですか?'; + String get leaveConversationQuestion => 'この会話を離れてもよろしいですか?'; @override String get showInChatLabel => 'チャットで表示'; @@ -348,9 +342,9 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get youText => '君'; @override - String get ofText => 'の';//TODO: break - // galleryPaginationText( - // {required int currentPage, required int totalPages}) + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '$totalPagesの${currentPage + 1}'; @override String get fileText => 'ファイル'; diff --git a/packages/stream_chat_localizations/test/translations_test.dart b/packages/stream_chat_localizations/test/translations_test.dart index 0e621159..c7314a58 100644 --- a/packages/stream_chat_localizations/test/translations_test.dart +++ b/packages/stream_chat_localizations/test/translations_test.dart @@ -174,7 +174,7 @@ void main() { expect(localizations.withText, isNotNull); expect(localizations.inText, isNotNull); expect(localizations.youText, isNotNull); - expect(localizations.ofText, isNotNull); + expect(localizations.galleryPaginationText, isNotNull); expect(localizations.fileText, isNotNull); expect(localizations.replyToMessageLabel, isNotNull); }); From 8ca7dab6da9d6f235f95dd476874b076c5baf988 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 15:36:43 -0400 Subject: [PATCH 04/32] update docs --- docusaurus/docs/Flutter/guides/adding_localization.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/Flutter/guides/adding_localization.mdx b/docusaurus/docs/Flutter/guides/adding_localization.mdx index 9eb4dd68..3a81187a 100644 --- a/docusaurus/docs/Flutter/guides/adding_localization.mdx +++ b/docusaurus/docs/Flutter/guides/adding_localization.mdx @@ -26,7 +26,7 @@ At the moment we support the following languages: - [Italian](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart) - [French](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart) - [Spanish](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart) - +- [Japanese](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart) More languages will be added in the future. Feel free to [contribute](https://github.com/GetStream/stream-chat-flutter/blob/master/CONTRIBUTING.md) to add more languages. ### Add dependency @@ -64,6 +64,7 @@ class MyApp extends StatelessWidget { Locale('fr'), Locale('it'), Locale('es'), + Locale('ja'), ], // Add GlobalStreamChatLocalizations.delegates localizationsDelegates: GlobalStreamChatLocalizations.delegates, @@ -133,6 +134,7 @@ Here is an example of how that would look like: Locale('fr'), Locale('it'), Locale('es'), + Locale('ja'), ], // locales are the locales of the device // supportedLocales are the app supported locales @@ -176,5 +178,6 @@ Example: fr it es + ja ``` From 95e3467ac49a19aea1e9cc3f8cf6af48e59f38cd Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 16:50:57 -0400 Subject: [PATCH 05/32] support for korean --- .../lib/src/stream_chat_localizations.dart | 5 + .../lib/src/stream_chat_localizations_ko.dart | 360 ++++++++++++++++++ 2 files changed, 365 insertions(+) create mode 100644 packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart diff --git a/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart b/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart index e65aab1f..4094dcaa 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart @@ -13,6 +13,8 @@ part 'stream_chat_localizations_it.dart'; part 'stream_chat_localizations_ja.dart'; +part 'stream_chat_localizations_ko.dart'; + part 'stream_chat_localizations_hi.dart'; /// The set of supported languages, as language code strings. @@ -30,6 +32,7 @@ const kStreamChatSupportedLanguages = { 'it', 'es', 'ja', + 'ko' }; /// Creates a [GlobalStreamChatLocalizations] instance for the given `locale`. @@ -64,6 +67,8 @@ GlobalStreamChatLocalizations? getStreamChatTranslation(Locale locale) { return const StreamChatLocalizationsEs(); case 'ja': return const StreamChatLocalizationsJa(); + case 'ko': + return const StreamChatLocalizationsKo(); } } 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 new file mode 100644 index 00000000..6fe285b7 --- /dev/null +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart @@ -0,0 +1,360 @@ +part of 'stream_chat_localizations.dart'; + +/// The translations for Korean (`ko`). +class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { + /// Create an instance of the translation bundle for Korean. + const StreamChatLocalizationsKo({String localeName = 'ko'}) + : super(localeName: localeName); + + @override + String get launchUrlError => 'URL을 시작할 수 없습니다.'; + + @override + String get loadingUsersError => '사용자를 로드하는 중 오류 발생'; + + @override + String get noUsersLabel => '현재 사용자가 없습니다.'; + + @override + String get retryLabel => '다시 시도하십시오.'; + + @override + String get userLastOnlineText => '마지막 온라인입니다.'; + + @override + String get userOnlineText => '온라인.'; + + @override + String userTypingText(Iterable users) { + if (users.isEmpty) return ''; + final first = users.first; + if (users.length == 1) { + return '${first.name} 타이핑하고 있어요.'; + } + return '${first.name}스와 ${users.length - 1}명이 타자를 치고 있습니다'; + } + + @override + String get threadReplyLabel => '스레드 응답입니다.'; + + @override + String get onlyVisibleToYouText => '당신만 볼 수 있습니다.'; + + @override + String threadReplyCountText(int count) => '$count스레드 응답입니다.'; + + @override + String attachmentsUploadProgressText({ + required int remaining, + required int total, + }) => + '${total}mb 중 ${remaining}mb를 업로드하는 중입니다...'; + + @override + String pinnedByUserText({ + required User pinnedBy, + required User currentUser, + }) { + final pinnedByCurrentUser = currentUser.id == pinnedBy.id; + if (pinnedByCurrentUser) return '당신에 의해 고정됩니다.'; + return '${pinnedBy.name} 핀으로 고정했습니다.'; + } + + @override + String get emptyMessagesText => '현재 메시지가 없습니다.'; + + @override + String get genericErrorText => '뭔가 잘못됐어요'; + + @override + String get loadingMessagesError => '메시지를 로드하는 동안 오류가 발생했습니다.'; + + @override + String resultCountText(int count) => '$count개 결과입니다.'; + + @override + String get messageDeletedText => '이 메시지는 삭제되었습니다.'; + + @override + String get messageDeletedLabel => '메시지가 삭제되었습니다.'; + + @override + String get messageReactionsLabel => '메시지에 대한 응답.'; + + @override + String get emptyChatMessagesText => '아직 채팅이 없습니다...'; + + @override + String threadSeparatorText(int replyCount) { + if (replyCount == 1) return '1 회신합니다.'; + return '$replyCount개의 응답입니다.'; + } + + @override + String get connectedLabel => '연결된'; + + @override + String get disconnectedLabel => '연결이 끊겼습니다.'; + + @override + String get reconnectingLabel => '다시 연결하는 중...'; + + @override + String get alsoSendAsDirectMessageLabel => '다이렉트 메시지로도 보냅니다.'; + + @override + String get addACommentOrSendLabel => '주석을 추가하거나 보냅니다.'; + + @override + String get searchGifLabel => 'GIF를 검색합니다.'; + + @override + String get writeAMessageLabel => '메시지를 쓰세요.'; + + @override + String get instantCommandsLabel => '인스턴트 커맨즈'; + + @override + String fileTooLargeAfterCompressionError(double limitInMB) => + '파일이 너무 커서 업로드할 수 없습니다. ' + '파일 크기 제한은 ${limitInMB}MB입니다. ' + '우리는 압축해 보았지만 충분하지 않았습니다.'; + + @override + String fileTooLargeError(double limitInMB) => + '파일이 너무 커서 업로드할 수 없습니다. 파일 크기 제한은 ${limitInMB}MB입니다.'; + + @override + String emojiMatchingQueryText(String query) => '"$query"과 일치하는 이모티콘입니다.'; + + @override + String get addAFileLabel => '파일을 추가합니다.'; + + @override + String get photoFromCameraLabel => '카메라에서 찍은 사진입니다.'; + + @override + String get uploadAFileLabel => '파일을 업로드합니다.'; + + @override + String get uploadAPhotoLabel => '사진을 업로드합니다.'; + + @override + String get uploadAVideoLabel => '비디오를 업로드하세요'; + + @override + String get videoFromCameraLabel => '카메라의 비디오입니다.'; + + @override + String get okLabel => '알았지'; + + @override + String get somethingWentWrongError => '뭔가 잘못됐어요'; + + @override + String get addMoreFilesLabel => '파일을 추가합니다.'; + + @override + String get enablePhotoAndVideoAccessMessage => '친구와 공유할 수 있도록 사진과' + '\n동영상에 액세스할 수 있도록 설정하십시오.'; + + @override + String get allowGalleryAccessMessage => '갤러리에 대한 액세스를 허용합니다.'; + + @override + String get flagMessageLabel => '플래그 메시지'; + + @override + String get flagMessageQuestion => '추가 조사를 위해 진행자에게 이 메시지의 복사본을 전송하시겠습니까?'; + + @override + String get flagLabel => '플래그를 지정합니다.'; + + @override + String get cancelLabel => '취소하십시오.'; + + @override + String get flagMessageSuccessfulLabel => '메시지에 플래그가 지정되었습니다.'; + + @override + String get flagMessageSuccessfulText => + '메시지가 진행자에게 보고되었습니다.'; + + @override + String get deleteLabel => '삭제합니다.'; + + @override + String get deleteMessageLabel => '메시지를 삭제합니다.'; + + @override + String get deleteMessageQuestion => + '이 메시지를 완전히 삭제하시겠습니까?'; + + @override + String get operationCouldNotBeCompletedText => + '작업을 완료할 수 없습니다.'; + + @override + String get replyLabel => '답글'; + + @override + String togglePinUnpinText({required bool pinned}) { + if (pinned) return '대화에서 연결을 해제합니다.'; + return '대화에 고정합니다.'; + } + + @override + String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) { + if (isDeleteFailed) return '메시지 삭제를 다시 시도하십시오.'; + return '메시지를 삭제합니다.'; + } + + @override + String get copyMessageLabel => '메시지를 복사합니다.'; + + @override + String get editMessageLabel => '메시지를 편집합니다.'; + + @override + String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) { + if (isUpdateFailed) return '편집된 메시지를 다시 보냅니다.'; + return '다시 보냅니다.'; + } + + @override + String get photosLabel => '사진들'; + + String _getDay(DateTime dateTime) { + final now = DateTime.now(); + final today = DateTime(now.year, now.month, now.day); + final yesterday = DateTime(now.year, now.month, now.day - 1); + + final date = DateTime(dateTime.year, dateTime.month, dateTime.day); + + if (date == today) { + return '오늘이요'; + } else if (date == yesterday) { + return '어제요'; + } else { + return '${Jiffy(date).MMMd}입니다.'; + } + } + + @override + String sentAtText({required DateTime date, required DateTime time}) => + '${_getDay(date)} 오전 ${Jiffy(time.toLocal()).format('HH:mm')}에 보냈습니다'; + + @override + String get todayLabel => '오늘이요'; + + @override + String get yesterdayLabel => '어제요'; + + @override + String get channelIsMutedText => '채널이 음소거됩니다.'; + + @override + String get noTitleText => '제목이 없습니다.'; + + @override + String get letsStartChattingLabel => '채팅 시작해요!'; + + @override + String get sendingFirstMessageLabel => + '친구에게 당신의 첫 번째 메시지를 보내는 것은 어떤가요?'; + + @override + String get startAChatLabel => '대화를 시작합니다.'; + + @override + String get loadingChannelsError => '채널을 로드하는 동안 오류가 발생했습니다.'; + + @override + String get deleteConversationLabel => '대화를 삭제합니다.'; + + @override + String get deleteConversationQuestion => + '이 대화를 삭제하시겠습니까?'; + + @override + String get streamChatLabel => '채팅을 스트리밍합니다.'; + + @override + String get searchingForNetworkText => '네트워크를 검색하는 중입니다.'; + + @override + String get offlineLabel => '오프라인...'; + + @override + String get tryAgainLabel => '다시 한 번 해 봐!'; + + @override + String membersCountText(int count) { + if (count == 1) return '회원 1명입니다.'; + return '$count 구성원'; + } + + @override + String watchersCountText(int count) { + if (count == 1) return '1 온라인입니다.'; + return '$count 온라인입니다'; + } + + @override + String get viewInfoLabel => '정보를 봅니다.'; + + @override + String get leaveGroupLabel => '그룹을 떠납니다.'; + + @override + String get leaveLabel => '떠나요'; + + @override + String get leaveConversationLabel => '대화에서 떠납니다.'; + + @override + String get leaveConversationQuestion => + '정말 이 대화에서 나가시겠습니까?'; + + @override + String get showInChatLabel => '채팅에 표시합니다.'; + + @override + String get saveImageLabel => '이미지를 저장합니다.'; + + @override + String get saveVideoLabel => '비디오를 저장합니다.'; + + @override + String get uploadErrorLabel => '업로드 오류입니다.'; + + @override + String get giphyLabel => '지피요'; + + @override + String get shuffleLabel => '섞으세요'; + + @override + String get sendLabel => '보냅니다'; + + @override + String get withText => '함께요'; + + @override + String get inText => '에 있습니다.'; + + @override + String get youText => '너'; + + @override + String galleryPaginationText( + {required int currentPage, required int totalPages}) => + '$totalPages장 ${currentPage + 1}장입니다'; + //11장 3장. + + @override + String get fileText => '파일'; + + @override + String get replyToMessageLabel => '메시지에 회신합니다.'; +} From bd8e4675c66595c0187ae2cf763166fbaf115588 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Wed, 4 Aug 2021 09:06:56 -0400 Subject: [PATCH 06/32] update korean based on Eric's review --- .../lib/src/stream_chat_localizations_ko.dart | 158 +++++++++--------- 1 file changed, 75 insertions(+), 83 deletions(-) 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 6fe285b7..689544c7 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 @@ -7,48 +7,48 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { : super(localeName: localeName); @override - String get launchUrlError => 'URL을 시작할 수 없습니다.'; + String get launchUrlError => 'URL을 시작할 수 없습니다'; @override String get loadingUsersError => '사용자를 로드하는 중 오류 발생'; @override - String get noUsersLabel => '현재 사용자가 없습니다.'; + String get noUsersLabel => '현재 사용자가 없습니다'; @override - String get retryLabel => '다시 시도하십시오.'; + String get retryLabel => '다시 시도하십시오'; @override - String get userLastOnlineText => '마지막 온라인입니다.'; + String get userLastOnlineText => '마지막 온라인입니다'; @override - String get userOnlineText => '온라인.'; + String get userOnlineText => '온라인'; @override String userTypingText(Iterable users) { if (users.isEmpty) return ''; final first = users.first; if (users.length == 1) { - return '${first.name} 타이핑하고 있어요.'; + return '${first.name} 타이핑중'; } - return '${first.name}스와 ${users.length - 1}명이 타자를 치고 있습니다'; + return '${first.name}하고 ${users.length - 1}명 타이핑중'; } @override - String get threadReplyLabel => '스레드 응답입니다.'; + String get threadReplyLabel => '스레드 응답입니다'; @override - String get onlyVisibleToYouText => '당신만 볼 수 있습니다.'; + String get onlyVisibleToYouText => '당신만 볼 수 있습니다'; @override - String threadReplyCountText(int count) => '$count스레드 응답입니다.'; + String threadReplyCountText(int count) => '$count스레드 답장'; @override String attachmentsUploadProgressText({ required int remaining, required int total, }) => - '${total}mb 중 ${remaining}mb를 업로드하는 중입니다...'; + '$remaining/${total}mb를 업로드중...'; @override String pinnedByUserText({ @@ -56,60 +56,59 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { required User currentUser, }) { final pinnedByCurrentUser = currentUser.id == pinnedBy.id; - if (pinnedByCurrentUser) return '당신에 의해 고정됩니다.'; - return '${pinnedBy.name} 핀으로 고정했습니다.'; + if (pinnedByCurrentUser) return '당신의 핀'; + return '${pinnedBy.name}의 핀'; } @override - String get emptyMessagesText => '현재 메시지가 없습니다.'; + String get emptyMessagesText => '현재 메시지가 없습니다'; @override - String get genericErrorText => '뭔가 잘못됐어요'; + String get genericErrorText => '뭔가 잘못됐습니다'; @override - String get loadingMessagesError => '메시지를 로드하는 동안 오류가 발생했습니다.'; + String get loadingMessagesError => '메시지를 로드하는 동안 오류가 발생했습니다'; @override - String resultCountText(int count) => '$count개 결과입니다.'; + String resultCountText(int count) => '$count개의 결과'; @override String get messageDeletedText => '이 메시지는 삭제되었습니다.'; @override - String get messageDeletedLabel => '메시지가 삭제되었습니다.'; + String get messageDeletedLabel => '메시지가 삭제되었습니다'; @override - String get messageReactionsLabel => '메시지에 대한 응답.'; + String get messageReactionsLabel => '메시지에 대한 응답'; @override String get emptyChatMessagesText => '아직 채팅이 없습니다...'; @override String threadSeparatorText(int replyCount) { - if (replyCount == 1) return '1 회신합니다.'; - return '$replyCount개의 응답입니다.'; + return '$replyCount개의 답장'; } @override - String get connectedLabel => '연결된'; + String get connectedLabel => '연결중'; @override - String get disconnectedLabel => '연결이 끊겼습니다.'; + String get disconnectedLabel => '연결이 끊겼습니다'; @override String get reconnectingLabel => '다시 연결하는 중...'; @override - String get alsoSendAsDirectMessageLabel => '다이렉트 메시지로도 보냅니다.'; + String get alsoSendAsDirectMessageLabel => '다이렉트 메시지로도 보냅니다'; @override - String get addACommentOrSendLabel => '주석을 추가하거나 보냅니다.'; + String get addACommentOrSendLabel => '주석을 추가하거나 보냅니다'; @override - String get searchGifLabel => 'GIF를 검색합니다.'; + String get searchGifLabel => 'GIF 검색'; @override - String get writeAMessageLabel => '메시지를 쓰세요.'; + String get writeAMessageLabel => '메시지 쓰기'; @override String get instantCommandsLabel => '인스턴트 커맨즈'; @@ -125,88 +124,85 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { '파일이 너무 커서 업로드할 수 없습니다. 파일 크기 제한은 ${limitInMB}MB입니다.'; @override - String emojiMatchingQueryText(String query) => '"$query"과 일치하는 이모티콘입니다.'; + String emojiMatchingQueryText(String query) => '"$query"과 일치하는 이모티콘입니다'; @override - String get addAFileLabel => '파일을 추가합니다.'; + String get addAFileLabel => '파일을 추가함'; @override - String get photoFromCameraLabel => '카메라에서 찍은 사진입니다.'; + String get photoFromCameraLabel => '카메라에서 찍은 사진'; @override - String get uploadAFileLabel => '파일을 업로드합니다.'; + String get uploadAFileLabel => '파일을 업로드함'; @override - String get uploadAPhotoLabel => '사진을 업로드합니다.'; + String get uploadAPhotoLabel => '사진을 업로드함'; @override - String get uploadAVideoLabel => '비디오를 업로드하세요'; + String get uploadAVideoLabel => '비디오를 업로드함'; @override - String get videoFromCameraLabel => '카메라의 비디오입니다.'; + String get videoFromCameraLabel => '카메라의 비디오.'; @override - String get okLabel => '알았지'; + String get okLabel => 'ㅇㅋ'; @override - String get somethingWentWrongError => '뭔가 잘못됐어요'; + String get somethingWentWrongError => '뭔가 잘못됐습느다'; @override - String get addMoreFilesLabel => '파일을 추가합니다.'; + String get addMoreFilesLabel => '파일을 추가함'; @override String get enablePhotoAndVideoAccessMessage => '친구와 공유할 수 있도록 사진과' '\n동영상에 액세스할 수 있도록 설정하십시오.'; @override - String get allowGalleryAccessMessage => '갤러리에 대한 액세스를 허용합니다.'; + String get allowGalleryAccessMessage => '갤러리에 대한 액세스를 허용합니다'; @override - String get flagMessageLabel => '플래그 메시지'; + String get flagMessageLabel => ' 메시지를 플래그함'; @override String get flagMessageQuestion => '추가 조사를 위해 진행자에게 이 메시지의 복사본을 전송하시겠습니까?'; @override - String get flagLabel => '플래그를 지정합니다.'; + String get flagLabel => '플래그함'; @override - String get cancelLabel => '취소하십시오.'; + String get cancelLabel => '취소'; @override - String get flagMessageSuccessfulLabel => '메시지에 플래그가 지정되었습니다.'; + String get flagMessageSuccessfulLabel => '메시지에 플래그가 지정되었습니다'; @override - String get flagMessageSuccessfulText => - '메시지가 진행자에게 보고되었습니다.'; + String get flagMessageSuccessfulText => '메시지가 진행자에게 보고되었습니다.'; @override - String get deleteLabel => '삭제합니다.'; + String get deleteLabel => '삭제'; @override String get deleteMessageLabel => '메시지를 삭제합니다.'; @override - String get deleteMessageQuestion => - '이 메시지를 완전히 삭제하시겠습니까?'; + String get deleteMessageQuestion => '이 메시지를 완전히 삭제하시겠습니까?'; @override - String get operationCouldNotBeCompletedText => - '작업을 완료할 수 없습니다.'; + String get operationCouldNotBeCompletedText => '작업을 완료할 수 없습니다.'; @override String get replyLabel => '답글'; @override String togglePinUnpinText({required bool pinned}) { - if (pinned) return '대화에서 연결을 해제합니다.'; - return '대화에 고정합니다.'; + if (pinned) return '대화의 핀을 분리합니다'; + return '대화에 고정합니다'; } @override String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) { - if (isDeleteFailed) return '메시지 삭제를 다시 시도하십시오.'; - return '메시지를 삭제합니다.'; + if (isDeleteFailed) return '메시지 삭제를 다시 시도합니다'; + return '메시지를 삭제합니다'; } @override @@ -222,7 +218,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { } @override - String get photosLabel => '사진들'; + String get photosLabel => '사진'; String _getDay(DateTime dateTime) { final now = DateTime.now(); @@ -232,23 +228,23 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { final date = DateTime(dateTime.year, dateTime.month, dateTime.day); if (date == today) { - return '오늘이요'; + return '오늘'; } else if (date == yesterday) { - return '어제요'; + return '어제'; } else { - return '${Jiffy(date).MMMd}입니다.'; + return '${Jiffy(date).MMMd}에'; } } @override String sentAtText({required DateTime date, required DateTime time}) => - '${_getDay(date)} 오전 ${Jiffy(time.toLocal()).format('HH:mm')}에 보냈습니다'; + '${_getDay(date)} ${Jiffy(time.toLocal()).format('HH:mm')}에 보냈습니다'; @override - String get todayLabel => '오늘이요'; + String get todayLabel => '오늘'; @override - String get yesterdayLabel => '어제요'; + String get yesterdayLabel => '어제'; @override String get channelIsMutedText => '채널이 음소거됩니다.'; @@ -260,8 +256,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get letsStartChattingLabel => '채팅 시작해요!'; @override - String get sendingFirstMessageLabel => - '친구에게 당신의 첫 번째 메시지를 보내는 것은 어떤가요?'; + String get sendingFirstMessageLabel => '친구에게 첫 메시지를 보내 볼까요?'; @override String get startAChatLabel => '대화를 시작합니다.'; @@ -273,11 +268,10 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get deleteConversationLabel => '대화를 삭제합니다.'; @override - String get deleteConversationQuestion => - '이 대화를 삭제하시겠습니까?'; + String get deleteConversationQuestion => '대화를 삭제하시겠습니까?'; @override - String get streamChatLabel => '채팅을 스트리밍합니다.'; + String get streamChatLabel => '스트림 채팅'; @override String get searchingForNetworkText => '네트워크를 검색하는 중입니다.'; @@ -286,35 +280,32 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get offlineLabel => '오프라인...'; @override - String get tryAgainLabel => '다시 한 번 해 봐!'; + String get tryAgainLabel => '다시 시도합니다'; @override String membersCountText(int count) { - if (count == 1) return '회원 1명입니다.'; - return '$count 구성원'; + return '$count명'; } @override String watchersCountText(int count) { - if (count == 1) return '1 온라인입니다.'; - return '$count 온라인입니다'; + return '$count명이 온라인'; } @override - String get viewInfoLabel => '정보를 봅니다.'; + String get viewInfoLabel => '정보를 보기'; @override String get leaveGroupLabel => '그룹을 떠납니다.'; @override - String get leaveLabel => '떠나요'; + String get leaveLabel => '떠나다'; @override String get leaveConversationLabel => '대화에서 떠납니다.'; @override - String get leaveConversationQuestion => - '정말 이 대화에서 나가시겠습니까?'; + String get leaveConversationQuestion => '정말 이 대화에서 나가시겠습니까?'; @override String get showInChatLabel => '채팅에 표시합니다.'; @@ -326,31 +317,32 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get saveVideoLabel => '비디오를 저장합니다.'; @override - String get uploadErrorLabel => '업로드 오류입니다.'; + String get uploadErrorLabel => '업로드 오류'; @override - String get giphyLabel => '지피요'; + String get giphyLabel => '지피'; @override - String get shuffleLabel => '섞으세요'; + String get shuffleLabel => '섞기'; @override - String get sendLabel => '보냅니다'; + String get sendLabel => '보내기'; @override - String get withText => '함께요'; + String get withText => '함께'; @override - String get inText => '에 있습니다.'; + String get inText => '에'; @override - String get youText => '너'; + String get youText => '고객님'; + // This is the word for 'customer' or 'user' because saying 'you' directly is too informal and rude @override String galleryPaginationText( {required int currentPage, required int totalPages}) => - '$totalPages장 ${currentPage + 1}장입니다'; - //11장 3장. + '${currentPage + 1} / $totalPages'; + //3 / 11 @override String get fileText => '파일'; From f311c13e4bc621b5e5a5b973861fb1be019d1c18 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Wed, 4 Aug 2021 09:20:28 -0400 Subject: [PATCH 07/32] update japanese based on Eric's input --- .../lib/src/stream_chat_localizations_ja.dart | 103 +++++++++--------- 1 file changed, 49 insertions(+), 54 deletions(-) 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 6522fbf7..a30bfe2f 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 @@ -1,16 +1,16 @@ part of 'stream_chat_localizations.dart'; -/// The translations for English (`ja`). +/// The translations for Japanese (`ja`). class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { /// Create an instance of the translation bundle for Japanese. const StreamChatLocalizationsJa({String localeName = 'ja'}) : super(localeName: localeName); @override - String get launchUrlError => 'ユーアーレルの起動ができない'; + String get launchUrlError => 'URLの起動ができません'; @override - String get loadingUsersError => 'ユーザーの読み込みエラー'; + String get loadingUsersError => 'ユーザーの読み込みができません'; @override String get noUsersLabel => '現在、ユーザーはいません。'; @@ -29,26 +29,26 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { if (users.isEmpty) return ''; final first = users.first; if (users.length == 1) { - return '${first.name}がタイプしている'; + return '${first.name}が入力しています'; } - return '${first.name}とあと${users.length - 1}人が入力しています'; + return '${first.name}と${users.length - 1}人が入力しています'; } @override String get threadReplyLabel => 'スレッド返信'; @override - String get onlyVisibleToYouText => '自分にしか見えない'; + String get onlyVisibleToYouText => '自分しか見れません'; @override - String threadReplyCountText(int count) => '$countスレッドの返信'; + String threadReplyCountText(int count) => '$countつのスレッド返信'; @override String attachmentsUploadProgressText({ required int remaining, required int total, }) => - '$remaining/${total}mbのアップロード 。。。'; + '$remaining/${total}mbのアップロード中 。。。'; @override String pinnedByUserText({ @@ -56,21 +56,21 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { required User currentUser, }) { final pinnedByCurrentUser = currentUser.id == pinnedBy.id; - if (pinnedByCurrentUser) return 'あなたのピン留'; - return '${pinnedBy.name}のピン留'; + if (pinnedByCurrentUser) return 'あなたのピン'; + return '${pinnedBy.name}のピン'; } @override String get emptyMessagesText => '現在、メッセージはありません。'; @override - String get genericErrorText => '何かが間違っていた'; + String get genericErrorText => 'エラーが発生しました'; @override String get loadingMessagesError => 'メッセージの読み込みエラー'; @override - String resultCountText(int count) => '$countつの結果'; + String resultCountText(int count) => '$count件の結果'; @override String get messageDeletedText => 'このメッセージは削除されました。'; @@ -79,34 +79,32 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get messageDeletedLabel => 'メッセージ削除'; @override - String get messageReactionsLabel => 'メッセージに対する反応'; + String get messageReactionsLabel => 'メッセージのリアクション'; @override - String get emptyChatMessagesText => 'ここではまだ会話はありませんが。。。'; + String get emptyChatMessagesText => 'チャットがありませんが。。。'; @override - String threadSeparatorText(int replyCount) { - if (replyCount == 1) return '1 回答'; - return '$replyCount件の返信'; - } + String threadSeparatorText(int replyCount)=> '$replyCount件の返信'; + @override - String get connectedLabel => 'コネクテッド'; + String get connectedLabel => '接続しています'; @override String get disconnectedLabel => '接続切れ'; @override - String get reconnectingLabel => 'リコネクティング。。。'; + String get reconnectingLabel => '再接続中。。。'; @override - String get alsoSendAsDirectMessageLabel => 'ダイレクトメッセージでも送信可能'; + String get alsoSendAsDirectMessageLabel => 'ダイレクトメッセージでも送信'; @override String get addACommentOrSendLabel => 'コメントの追加や送信'; @override - String get searchGifLabel => '検索用GIF'; + String get searchGifLabel => 'GIFの検索'; @override String get writeAMessageLabel => 'メッセージを書く'; @@ -149,7 +147,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get okLabel => 'よし'; @override - String get somethingWentWrongError => '何かが間違っていたのだ。'; + String get somethingWentWrongError => 'エラーが発生しました'; @override String get addMoreFilesLabel => 'ファイルの追加'; @@ -158,29 +156,29 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get enablePhotoAndVideoAccessMessage => 'お友達と共有できるように、写真' '\nやビデオへのアクセスを有効にしてください。'; @override - String get allowGalleryAccessMessage => 'お客様のギャラリーへのアクセスを許可する'; + String get allowGalleryAccessMessage => 'ギャラリーへのアクセスを許可する'; @override - String get flagMessageLabel => 'メッセージフラグが'; + String get flagMessageLabel => 'メッセージをフラグする'; @override String get flagMessageQuestion => 'このメッセージのコピーを' '\nモデレーターに送って、さらに調査してもらいますか?'; @override - String get flagLabel => 'フラグが'; + String get flagLabel => 'フラグする'; @override String get cancelLabel => 'キャンセル'; @override - String get flagMessageSuccessfulLabel => 'フラグ付メッセージ'; + String get flagMessageSuccessfulLabel => 'メッセージにフラグが付けられました'; @override String get flagMessageSuccessfulText => 'このメッセージはモデレーターに報告されました。'; @override - String get deleteLabel => '消す'; + String get deleteLabel => '削除'; @override String get deleteMessageLabel => 'メッセージを削除する '; @@ -197,25 +195,25 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { @override String togglePinUnpinText({required bool pinned}) { - if (pinned) return 'カンバセーションからピンを外す '; - return '会話へのピン'; + if (pinned) return '会話のピンを外す'; + return '会話にピンする'; } @override String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) { - if (isDeleteFailed) return 'メッセージの削除を再試行してください'; + if (isDeleteFailed) return 'メッセージの削除を再試行する'; return 'メッセージを削除する'; } @override - String get copyMessageLabel => 'コピーメッセージ'; + String get copyMessageLabel => 'メッセージをコピーする'; @override - String get editMessageLabel => 'メッセージの編集'; + String get editMessageLabel => 'メッセージを編集する'; @override String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) { - if (isUpdateFailed) return '編集したメッセージの再送'; + if (isUpdateFailed) return '編集したメッセージを再送する'; return '再送'; } @@ -240,7 +238,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { @override String sentAtText({required DateTime date, required DateTime time}) => - '${_getDay(date)} at ${Jiffy(time.toLocal()).format('HH:mm')}に送信 '; + '${_getDay(date)}の${Jiffy(time.toLocal()).format('HH:mm')}に送信しました '; @override String get todayLabel => '今日'; @@ -249,16 +247,16 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get yesterdayLabel => '昨日'; @override - String get channelIsMutedText => 'チャンネルがミュートされています'; + String get channelIsMutedText => 'チャンネルが無音されています'; @override String get noTitleText => 'タイトル無し'; @override - String get letsStartChattingLabel => 'さあ、チャットを始めよう'; + String get letsStartChattingLabel => 'チャットを始めよう!'; @override - String get sendingFirstMessageLabel => 'どのように友人にあなたの最初のメッセージを送ることについてはどうですか?'; + String get sendingFirstMessageLabel => '友人に最初のメッセージを送りましょうか?'; @override String get startAChatLabel => 'チャットを開始する'; @@ -270,13 +268,13 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get deleteConversationLabel => '会話を削除する'; @override - String get deleteConversationQuestion => 'この会話を削除してもよろしいですか?'; + String get deleteConversationQuestion => '本当に会話を削除しますか?'; @override String get streamChatLabel => 'ストリームチャット'; @override - String get searchingForNetworkText => 'ネットワークの検索'; + String get searchingForNetworkText => 'ネットワークを検索中'; @override String get offlineLabel => 'オフライン。。。'; @@ -285,16 +283,10 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get tryAgainLabel => '再試行する'; @override - String membersCountText(int count) { - if (count == 1) return '1人のメンバー'; - return '$count人のメンバー'; - } + String membersCountText(int count) => '$count人のメンバー'; @override - String watchersCountText(int count) { - if (count == 1) return '1オンライン'; - return '$countオンライン'; - } + String watchersCountText(int count) => '$count人がオンライン'; @override String get viewInfoLabel => '情報を見る'; @@ -309,7 +301,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get leaveConversationLabel => '会話を離れる'; @override - String get leaveConversationQuestion => 'この会話を離れてもよろしいですか?'; + String get leaveConversationQuestion => '本当に会話を離れますか?'; @override String get showInChatLabel => 'チャットで表示'; @@ -336,15 +328,18 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get withText => 'と'; @override - String get inText => 'は'; + String get inText => 'に'; @override - String get youText => '君'; + String get youText => 'お客様'; + // This is the word for 'customer' or 'user' because saying 'you' directly is too informal and rude @override - String galleryPaginationText( - {required int currentPage, required int totalPages}) => - '$totalPagesの${currentPage + 1}'; + String galleryPaginationText({ + required int currentPage, + required int totalPages, + }) => + '${currentPage + 1} / $totalPages'; @override String get fileText => 'ファイル'; From 74f3e109fd02615d55dda0abd80c092db70a85a0 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Wed, 4 Aug 2021 09:59:29 -0400 Subject: [PATCH 08/32] =?UTF-8?q?update=20okLabel:=20=E3=85=87=E3=85=8B->?= =?UTF-8?q?=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/src/stream_chat_localizations_ko.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 689544c7..36c578e3 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 @@ -145,7 +145,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get videoFromCameraLabel => '카메라의 비디오.'; @override - String get okLabel => 'ㅇㅋ'; + String get okLabel => '확인'; @override String get somethingWentWrongError => '뭔가 잘못됐습느다'; From 1c3927101513e9012ffb6429aeab0ecb0f2439f9 Mon Sep 17 00:00:00 2001 From: Gordon Hayes Date: Wed, 4 Aug 2021 17:30:56 +0200 Subject: [PATCH 09/32] docs: fix links, grammar --- .../docs/Flutter/basics/introduction.mdx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/docusaurus/docs/Flutter/basics/introduction.mdx b/docusaurus/docs/Flutter/basics/introduction.mdx index 756bd33f..ad1df5af 100644 --- a/docusaurus/docs/Flutter/basics/introduction.mdx +++ b/docusaurus/docs/Flutter/basics/introduction.mdx @@ -8,13 +8,14 @@ Exploring The Basics Of Stream Chat ![](../assets/sdk_title.png) -Stream Chat is a service that helps you easily build a full chat experience in your Flutter (and more) apps. +Stream Chat is a service that helps you easily build a full chat experience in your Flutter apps. +We also support a variety of other SDKs. This section of the documentation focuses on our Flutter SDK which helps you easily -ship high quality messaging experiences in apps and programs built with the [Flutter toolkit made +ship high quality messaging experiences in apps and programs built with the [Flutter toolkit by Google](https://flutter.dev). -The Stream Chat Flutter SDK comprises of four different packages to choose from ranging from ones +The Stream Chat Flutter SDK comprises five different packages to choose from, ranging from ones giving you complete control to ones that give you a rich out-of-the-box chat experience. The packages that make up the Stream Chat SDK are: @@ -30,28 +31,28 @@ reusable and customisable UI components. saving chat data locally. 5. Localizations (stream_chat_localizations): provides a set of localizations for the SDK. -We recommend building prototypes using the full UI package since it contains UI widgets already -integrated with Stream's API. [stream_chat_flutter](https://pub.dev/packages/stream_chat_flutter) -is the fastest way to get up and running using Stream chat in your app. +We recommend building prototypes using the full UI package, [stream_chat_flutter](https://pub.dev/packages/stream_chat_flutter), +since it contains UI widgets already integrated with Stream's API. Is the fastest way to get up +and running using Stream chat in your app. The Flutter SDK enables you to build any type of chat or messaging experience for Android, iOS, Web and Desktop. If you're building a very custom UI and would prefer a more lean package, -our [core package](https://pub.dev/packages/stream_chat_flutter) will be suited to this use case. Core allows you to build custom, -expressive UIs while retaining the benefits of our full Flutter SDK. -APIs for accessing and controlling users, sending messages, etc are seamlessly integrated into -this package and accessible via providers and builders. +[stream_chat_flutter_core](https://pub.dev/packages/stream_chat_flutter_core) will be suited to this +use case. Core allows you to build custom, expressive UIs while retaining the benefits of our full +Flutter SDK. APIs for accessing and controlling users, sending messages, and so forth are seamlessly integrated +into this package and accessible via providers and builders. Before going into the docs, let's take a small detour to look at how the elements of Stream Chat are structured. ### Basic Structure -There are two core elements in chat, Users and Channels. +There are two core elements in chat, Users and Channels. Channels are groups of one or more users that can message each other. In an app, you need to have a user connected to query channels. -There is no specific distinction between a chat between two people and a group chat, +There is no specific distinction between a chat with only two people and a group chat, but there is a way to create a unique chat between a certain number of people by creating a distinct channel. ![](../assets/chat_basics.png) @@ -68,7 +69,7 @@ While this is a simplistic overview of the service, the Flutter SDK handles the Before reading the docs, consider trying our [online API tour](https://getstream.io/chat/get_started/), it is a nice way to learn how the API works. -It's in-browser so Javascript-based but the ideas are pretty much the same as Dart. +It's in-browser so you'll need to use Javascript but the core conceps are pretty much the same as Dart. You may also like to look at the [Flutter tutorial](https://getstream.io/chat/flutter/tutorial/) which focuses on using the UI package to get Stream Chat integrated into a Flutter app. From 3cddec630122dfe89fea816b604f6d4a31bab8ce Mon Sep 17 00:00:00 2001 From: Gordon Hayes Date: Wed, 4 Aug 2021 17:34:34 +0200 Subject: [PATCH 10/32] docs: mention localization --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0faad799..3bb5a923 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,6 +52,8 @@ Stream's Flutter code is kept in a single mono-repository consisting of multiple `stream_chat_persistence` - This package provides a persistence client for fetching and saving chat data locally. Stream Chat Persistence uses Moor as a disk cache. +`stream_chat_localizations` - This package provides a set of localizations for the SDK. + ### Local Setup Congratulations! 🎉. You've successfully cloned our repo, and you are ready to make your first contribution. Before you can start making code changes, there are a few things to configure. From 3ef2c4027c2189fd3f5cad3a0349e029e853b648 Mon Sep 17 00:00:00 2001 From: Gordon Hayes Date: Wed, 4 Aug 2021 17:55:56 +0200 Subject: [PATCH 11/32] docs: grammar fixes --- docusaurus/docs/Flutter/basics/introduction.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/Flutter/basics/introduction.mdx b/docusaurus/docs/Flutter/basics/introduction.mdx index ad1df5af..99170774 100644 --- a/docusaurus/docs/Flutter/basics/introduction.mdx +++ b/docusaurus/docs/Flutter/basics/introduction.mdx @@ -13,7 +13,7 @@ We also support a variety of other SDKs. This section of the documentation focuses on our Flutter SDK which helps you easily ship high quality messaging experiences in apps and programs built with the [Flutter toolkit -by Google](https://flutter.dev). +made by Google](https://flutter.dev). The Stream Chat Flutter SDK comprises five different packages to choose from, ranging from ones giving you complete control to ones that give you a rich out-of-the-box chat experience. @@ -32,7 +32,7 @@ saving chat data locally. 5. Localizations (stream_chat_localizations): provides a set of localizations for the SDK. We recommend building prototypes using the full UI package, [stream_chat_flutter](https://pub.dev/packages/stream_chat_flutter), -since it contains UI widgets already integrated with Stream's API. Is the fastest way to get up +since it contains UI widgets already integrated with Stream's API. It is the fastest way to get up and running using Stream chat in your app. The Flutter SDK enables you to build any type of chat or messaging experience for Android, iOS, Web From e1d97feaabb50b51edd87c1b468cceb8c41563af Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Wed, 4 Aug 2021 16:33:52 -0400 Subject: [PATCH 12/32] add korean to tranlsation docs --- docusaurus/docs/Flutter/guides/adding_localization.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docusaurus/docs/Flutter/guides/adding_localization.mdx b/docusaurus/docs/Flutter/guides/adding_localization.mdx index 3a81187a..5a8813c2 100644 --- a/docusaurus/docs/Flutter/guides/adding_localization.mdx +++ b/docusaurus/docs/Flutter/guides/adding_localization.mdx @@ -27,6 +27,7 @@ At the moment we support the following languages: - [French](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart) - [Spanish](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart) - [Japanese](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart) +- [Korean](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart) More languages will be added in the future. Feel free to [contribute](https://github.com/GetStream/stream-chat-flutter/blob/master/CONTRIBUTING.md) to add more languages. ### Add dependency @@ -65,6 +66,7 @@ class MyApp extends StatelessWidget { Locale('it'), Locale('es'), Locale('ja'), + Locale('ko'), ], // Add GlobalStreamChatLocalizations.delegates localizationsDelegates: GlobalStreamChatLocalizations.delegates, @@ -135,6 +137,7 @@ Here is an example of how that would look like: Locale('it'), Locale('es'), Locale('ja'), + Locale('ko'), ], // locales are the locales of the device // supportedLocales are the app supported locales @@ -179,5 +182,6 @@ Example: it es ja + ko ``` From 57e9552248230c16291989f4509e074bc33afd61 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Thu, 5 Aug 2021 13:36:15 -0400 Subject: [PATCH 13/32] updating youText in ja + ko based on Eric's input --- .../lib/src/stream_chat_localizations_ja.dart | 2 +- .../lib/src/stream_chat_localizations_ko.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 a30bfe2f..e8d9759e 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 @@ -331,7 +331,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get inText => 'に'; @override - String get youText => 'お客様'; + String get youText => 'あなた'; // This is the word for 'customer' or 'user' because saying 'you' directly is too informal and rude @override 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 36c578e3..dbd9609d 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 @@ -335,7 +335,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get inText => '에'; @override - String get youText => '고객님'; + String get youText => '당신'; // This is the word for 'customer' or 'user' because saying 'you' directly is too informal and rude @override From 7b7a65cd70c56888de3cb1506faa7a5027108f86 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 13 Aug 2021 11:50:07 +0530 Subject: [PATCH 14/32] fix(localization): Fix hindi translations. Signed-off-by: xsahil03x --- .../lib/src/stream_chat_localizations_hi.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 850e481b..7d7f54d2 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 @@ -197,7 +197,7 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { 'कार्रवाई पूरी नहीं की जा सकी.'; @override - String get replyLabel => 'रिप्लाई'; + String get replyLabel => 'जवाब दें'; @override String togglePinUnpinText({required bool pinned}) { @@ -224,7 +224,7 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { } @override - String get photosLabel => 'तस्वीरें'; + String get photosLabel => 'फ़ोटोज'; String _getDay(DateTime dateTime) { final now = DateTime.now(); @@ -250,10 +250,10 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { String get todayLabel => 'आज'; @override - String get yesterdayLabel => 'बिता हुआ कल'; + String get yesterdayLabel => 'कल'; @override - String get channelIsMutedText => 'चैनल मौन है'; + String get channelIsMutedText => 'चैनल म्यूट है'; @override String get noTitleText => 'कोई शीर्षक नहीं'; From 955b5f1c0b0829d949f9218921f229b814287976 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 13 Aug 2021 11:55:56 +0530 Subject: [PATCH 15/32] chore(localization): Update changelog. Signed-off-by: xsahil03x --- packages/stream_chat_localizations/CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 865741c4..0845fa05 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -1,6 +1,18 @@ ## Upcoming -* Added support for [Spanish](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart) locale. +✅ Added + +* Added support + for [Spanish](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart) + locale. + +🔄 Changed + +* Some of the `Hindi` translations have been updated/changed for better understanding. + - 'रिप्लाई' -> 'जवाब दें' + - 'तस्वीरें' -> 'फ़ोटोज' + - 'बिता हुआ कल' -> 'कल' + - 'चैनल मौन है' -> 'चैनल म्यूट है' ## 1.0.2 From 3e4d39308f883f58733f1023aae254698c29a6bf Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Mon, 16 Aug 2021 20:19:55 +0530 Subject: [PATCH 16/32] refactor(llc, ui): Make Streams non-nullable wherever possible. Signed-off-by: xsahil03x --- .../stream_chat/lib/src/client/channel.dart | 86 +++++++++---------- .../lib/src/channel_preview.dart | 2 +- .../lib/src/message_list_view.dart | 4 +- 3 files changed, 42 insertions(+), 50 deletions(-) diff --git a/packages/stream_chat/lib/src/client/channel.dart b/packages/stream_chat/lib/src/client/channel.dart index b22a57cc..3285db75 100644 --- a/packages/stream_chat/lib/src/client/channel.dart +++ b/packages/stream_chat/lib/src/client/channel.dart @@ -153,9 +153,9 @@ class Channel { true; /// Returns true if the channel is muted, as a stream. - Stream? get isMutedStream => _client.state.currentUserStream + Stream get isMutedStream => _client.state.currentUserStream .map((event) => - event!.channelMutes.any((element) => element.channel.cid == cid) == + event?.channelMutes.any((element) => element.channel.cid == cid) == true) .distinct(); @@ -168,105 +168,97 @@ class Channel { /// Channel configuration. ChannelConfig? get config { _checkInitialized(); - return state?._channelState.channel?.config; + return state!._channelState.channel?.config; } /// Channel configuration as a stream. - Stream? get configStream { + Stream get configStream { _checkInitialized(); - return state?.channelStateStream.map((cs) => cs.channel?.config); + return state!.channelStateStream.map((cs) => cs.channel?.config); } /// Channel user creator. User? get createdBy { _checkInitialized(); - return state?._channelState.channel?.createdBy; + return state!._channelState.channel?.createdBy; } /// Channel user creator as a stream. - Stream? get createdByStream { + Stream get createdByStream { _checkInitialized(); - return state?.channelStateStream.map((cs) => cs.channel?.createdBy); + return state!.channelStateStream.map((cs) => cs.channel?.createdBy); } /// Channel frozen status. - bool? get frozen { + bool get frozen { _checkInitialized(); - return state?._channelState.channel?.frozen; + return state!._channelState.channel?.frozen == true; } /// Channel frozen status as a stream. - Stream? get frozenStream { + Stream get frozenStream { _checkInitialized(); - return state?.channelStateStream.map((cs) => cs.channel?.frozen); + return state!.channelStateStream.map((cs) => cs.channel?.frozen == true); } /// Channel creation date. DateTime? get createdAt { _checkInitialized(); - return state?._channelState.channel?.createdAt; + return state!._channelState.channel?.createdAt; } /// Channel creation date as a stream. - Stream? get createdAtStream { + Stream get createdAtStream { _checkInitialized(); - return state?.channelStateStream.map((cs) => cs.channel?.createdAt); + return state!.channelStateStream.map((cs) => cs.channel?.createdAt); } /// Channel last message date. DateTime? get lastMessageAt { _checkInitialized(); - - return state?._channelState.channel?.lastMessageAt; + return state!._channelState.channel?.lastMessageAt; } /// Channel last message date as a stream. - Stream? get lastMessageAtStream { + Stream get lastMessageAtStream { _checkInitialized(); - - return state?.channelStateStream.map((cs) => cs.channel?.lastMessageAt); + return state!.channelStateStream.map((cs) => cs.channel?.lastMessageAt); } /// Channel updated date. DateTime? get updatedAt { _checkInitialized(); - - return state?._channelState.channel?.updatedAt; + return state!._channelState.channel?.updatedAt; } /// Channel updated date as a stream. - Stream? get updatedAtStream { + Stream get updatedAtStream { _checkInitialized(); - - return state?.channelStateStream.map((cs) => cs.channel?.updatedAt); + return state!.channelStateStream.map((cs) => cs.channel?.updatedAt); } /// Channel deletion date. DateTime? get deletedAt { _checkInitialized(); - - return state?._channelState.channel?.deletedAt; + return state!._channelState.channel?.deletedAt; } /// Channel deletion date as a stream. - Stream? get deletedAtStream { + Stream get deletedAtStream { _checkInitialized(); - - return state?.channelStateStream.map((cs) => cs.channel?.deletedAt); + return state!.channelStateStream.map((cs) => cs.channel?.deletedAt); } /// Channel member count. int? get memberCount { _checkInitialized(); - - return state?._channelState.channel?.memberCount; + return state!._channelState.channel?.memberCount; } /// Channel member count as a stream. - Stream? get memberCountStream { + Stream get memberCountStream { _checkInitialized(); - - return state?.channelStateStream.map((cs) => cs.channel?.memberCount); + return state!.channelStateStream.map((cs) => cs.channel?.memberCount); } /// Channel id. @@ -281,7 +273,7 @@ class Channel { /// Channel team. String? get team { _checkInitialized(); - return state?._channelState.channel?.team; + return state!._channelState.channel?.team; } /// Channel extra data. @@ -294,7 +286,7 @@ class Channel { } /// Channel extra data as a stream. - Stream> get extraDataStream { + Stream> get extraDataStream { _checkInitialized(); return state!.channelStateStream.map( (cs) => cs.channel?.extraData ?? _extraData, @@ -1728,9 +1720,9 @@ class ChannelClientState { (event) { final readList = List.from(_channelState.read); final userReadIndex = - read?.indexWhere((r) => r.user.id == event.user!.id); + read.indexWhere((r) => r.user.id == event.user!.id); - if (userReadIndex != null && userReadIndex != -1) { + if (userReadIndex != -1) { final userRead = readList.removeAt(userReadIndex); if (userRead.user.id == _channel._client.state.currentUser!.id) { unreadCount = 0; @@ -1751,15 +1743,15 @@ class ChannelClientState { List get messages => _channelState.messages; /// Channel message list as a stream. - Stream?> get messagesStream => channelStateStream + Stream> get messagesStream => channelStateStream .map((cs) => cs.messages) .distinct(const ListEquality().equals); /// Channel pinned message list. - List? get pinnedMessages => _channelState.pinnedMessages.toList(); + List get pinnedMessages => _channelState.pinnedMessages.toList(); /// Channel pinned message list as a stream. - Stream?> get pinnedMessagesStream => + Stream> get pinnedMessagesStream => channelStateStream.map((cs) => cs.pinnedMessages.toList()); /// Get channel last message. @@ -1768,8 +1760,8 @@ class ChannelClientState { : null; /// Get channel last message. - Stream get lastMessageStream => messagesStream - .map((event) => event?.isNotEmpty == true ? event!.last : null); + Stream get lastMessageStream => + messagesStream.map((event) => event.isNotEmpty ? event.last : null); /// Channel members list. List get members => _channelState.members @@ -1806,10 +1798,10 @@ class ChannelClientState { ); /// Channel read list. - List? get read => _channelState.read; + List get read => _channelState.read; /// Channel read list as a stream. - Stream?> get readStream => channelStateStream.map((cs) => cs.read); + Stream> get readStream => channelStateStream.map((cs) => cs.read); final BehaviorSubject _unreadCountController = BehaviorSubject.seeded(0); @@ -2060,7 +2052,7 @@ class ChannelClientState { .toList(); updateChannelState(_channelState.copyWith( - pinnedMessages: pinnedMessages!.where(_pinIsValid()).toList(), + pinnedMessages: pinnedMessages.where(_pinIsValid()).toList(), messages: expiredMessages, )); } diff --git a/packages/stream_chat_flutter/lib/src/channel_preview.dart b/packages/stream_chat_flutter/lib/src/channel_preview.dart index 333ee886..e01cd008 100644 --- a/packages/stream_chat_flutter/lib/src/channel_preview.dart +++ b/packages/stream_chat_flutter/lib/src/channel_preview.dart @@ -132,7 +132,7 @@ class ChannelPreview extends StatelessWidget { message: lastMessage!, size: channelPreviewTheme.indicatorIconSize, isMessageRead: channel.state!.read - ?.where((element) => + .where((element) => element.user.id != channel .client.state.currentUser!.id) diff --git a/packages/stream_chat_flutter/lib/src/message_list_view.dart b/packages/stream_chat_flutter/lib/src/message_list_view.dart index a3830966..54634257 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view.dart @@ -915,7 +915,7 @@ class _MessageListViewState extends State { } final channel = streamChannel!.channel; - final readList = channel.state?.read?.where((read) { + final readList = channel.state?.read.where((read) { if (read.user.id == userId) return false; return read.lastRead.isAfter(message.createdAt) || read.lastRead.isAtSameMomentAs(message.createdAt); @@ -1204,7 +1204,7 @@ class _MessageListViewState extends State { builder: (_) => BetterStreamBuilder( stream: streamChannel!.channel.state!.messagesStream.map( (messages) => - messages!.firstWhere((m) => m.id == message.id)), + messages.firstWhere((m) => m.id == message.id)), initialData: message, builder: (_, data) => StreamChannel( channel: streamChannel!.channel, From b4329786e8682a680c26980a6dc4cc173dadf73d Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 10:00:59 +0200 Subject: [PATCH 17/32] fix(ui): date dividers in not reversed message list view --- .../lib/src/message_list_view.dart | 41 +++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_list_view.dart b/packages/stream_chat_flutter/lib/src/message_list_view.dart index a3830966..82697640 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view.dart @@ -505,8 +505,14 @@ class _MessageListViewState extends State { if (i == 1 || i == itemCount - 4) return const Offstage(); - final message = messages[i - 1]; - final nextMessage = messages[i - 2]; + late final Message message, nextMessage; + if (widget.reverse) { + message = messages[i - 1]; + nextMessage = messages[i - 2]; + } else { + message = messages[i - 2]; + nextMessage = messages[i - 1]; + } if (!Jiffy(message.createdAt.toLocal()).isSame( nextMessage.createdAt.toLocal(), Units.DAY, @@ -636,8 +642,7 @@ class _MessageListViewState extends State { } Positioned _buildFloatingDateDivider(int itemCount) => Positioned( - top: widget.reverse ? 20 : null, - bottom: widget.reverse ? null : 20, + top: 20, left: 0, right: 0, child: BetterStreamBuilder>( @@ -647,16 +652,27 @@ class _MessageListViewState extends State { if (a == null || b == null) { return false; } - final aTop = _getTopElementIndex(a); - final bTop = _getTopElementIndex(b); - return aTop == bTop; + if (widget.reverse) { + final aTop = _getTopElementIndex(a); + final bTop = _getTopElementIndex(b); + return aTop == bTop; + } else { + final aBottom = _getBottomElementIndex(a); + final bBottom = _getBottomElementIndex(b); + return aBottom == bBottom; + } }, builder: (context, values) { if (values.isEmpty || messages.isEmpty) { return const Offstage(); } - final index = _getTopElementIndex(values); + late final int? index; + if (widget.reverse) { + index = _getTopElementIndex(values); + } else { + index = _getBottomElementIndex(values); + } if (index == null || index <= 2 || index >= itemCount - 3) { return const Offstage(); @@ -685,6 +701,15 @@ class _MessageListViewState extends State { .index; } + int? _getBottomElementIndex(Iterable values) { + final inView = values.where((position) => position.itemLeadingEdge < 1); + if (inView.isEmpty) return null; + return inView + .reduce((min, position) => + position.itemLeadingEdge < min.itemLeadingEdge ? position : min) + .index; + } + Widget _buildScrollToBottom() => StreamBuilder>( stream: Rx.combineLatest2( streamChannel!.channel.state!.isUpToDateStream.distinct(), From 79b2d91902b75a3235cde2507cf0c84f060a9999 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 10:01:50 +0200 Subject: [PATCH 18/32] chore(ui): update changelog --- packages/stream_chat_flutter/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index add2c3cf..9138d952 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -45,6 +45,7 @@ breakdown: 🐞 Fixed - Fixed `MessageInput` textField case where `input` is not enabled if the file picked from the camera is null. +- Fixed date dividers in not reversed `MessageListView`. ## 2.1.2 From 607ad40443b818a61afd2acf0c5b1f496e1cc245 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 10:32:56 +0200 Subject: [PATCH 19/32] fix(core): `ChannelListView` pagination on refresh --- packages/stream_chat_flutter_core/lib/src/channels_bloc.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart b/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart index 46aaccee..6687eef5 100644 --- a/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart +++ b/packages/stream_chat_flutter_core/lib/src/channels_bloc.dart @@ -106,6 +106,9 @@ class ChannelsBlocState extends State final client = _streamChatCoreState!.client; final clear = paginationParams.offset == 0; + if (clear && _paginationEnded) { + _paginationEnded = false; + } if ((!clear && _paginationEnded) || _queryChannelsLoadingController.value == true) { From 6fb8c8731e2d6ba36f94d2856140f0b97828870a Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Tue, 17 Aug 2021 14:46:44 +0530 Subject: [PATCH 20/32] fix(ui): fix test Signed-off-by: xsahil03x --- packages/stream_chat_flutter/test/src/channel_preview_test.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/stream_chat_flutter/test/src/channel_preview_test.dart b/packages/stream_chat_flutter/test/src/channel_preview_test.dart index 7d0c549e..d6f3a5ea 100644 --- a/packages/stream_chat_flutter/test/src/channel_preview_test.dart +++ b/packages/stream_chat_flutter/test/src/channel_preview_test.dart @@ -21,6 +21,8 @@ void main() { when(() => clientState.currentUser).thenReturn(user); when(() => clientState.currentUserStream) .thenAnswer((_) => Stream.value(user)); + when(() => channel.lastMessageAtStream) + .thenAnswer((_) => Stream.value(lastMessageAt)); when(() => channel.lastMessageAt).thenReturn(lastMessageAt); when(() => channel.state).thenReturn(channelState); when(() => channel.client).thenReturn(client); From d0f5f4af8322067d131ef5fc43dec76fdd882978 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 11:19:02 +0200 Subject: [PATCH 21/32] fix format --- packages/stream_chat_flutter/lib/src/message_list_view.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_list_view.dart b/packages/stream_chat_flutter/lib/src/message_list_view.dart index 54634257..d7a49051 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view.dart @@ -1203,8 +1203,7 @@ class _MessageListViewState extends State { MaterialPageRoute( builder: (_) => BetterStreamBuilder( stream: streamChannel!.channel.state!.messagesStream.map( - (messages) => - messages.firstWhere((m) => m.id == message.id)), + (messages) => messages.firstWhere((m) => m.id == message.id)), initialData: message, builder: (_, data) => StreamChannel( channel: streamChannel!.channel, From ad4be0e9d639ed51f9f358a88ec0a97657facb84 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 11:26:16 +0200 Subject: [PATCH 22/32] update changelog --- packages/stream_chat_flutter_core/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/stream_chat_flutter_core/CHANGELOG.md b/packages/stream_chat_flutter_core/CHANGELOG.md index ef24e401..65280674 100644 --- a/packages/stream_chat_flutter_core/CHANGELOG.md +++ b/packages/stream_chat_flutter_core/CHANGELOG.md @@ -1,3 +1,8 @@ +## Upcoming + +🐞 Fixed +- [#612](https://github.com/GetStream/stream-chat-flutter/issues/612) `ChannelListView` pagination doesn't work after refresh + ## 2.1.1 - Updated llc dependency From 7cdc2b98e51529e754cd287ddb00a123530403d2 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 11:59:45 +0200 Subject: [PATCH 23/32] Update packages/stream_chat_flutter/CHANGELOG.md Co-authored-by: Sahil Kumar --- packages/stream_chat_flutter/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 9138d952..b21acc7a 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -45,7 +45,7 @@ breakdown: 🐞 Fixed - Fixed `MessageInput` textField case where `input` is not enabled if the file picked from the camera is null. -- Fixed date dividers in not reversed `MessageListView`. +- Fixed date dividers position/alignment in non reversed `MessageListView`. ## 2.1.2 From 56bd3b5b50ec6e461ab8bc5221c9bd3db67a1afe Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 17 Aug 2021 12:34:38 +0200 Subject: [PATCH 24/32] fix(core): always show date divider --- .../lib/src/message_list_view.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_list_view.dart b/packages/stream_chat_flutter/lib/src/message_list_view.dart index 82697640..8d83ab9d 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view.dart @@ -667,7 +667,7 @@ class _MessageListViewState extends State { return const Offstage(); } - late final int? index; + int? index; if (widget.reverse) { index = _getTopElementIndex(values); } else { @@ -675,7 +675,14 @@ class _MessageListViewState extends State { } if (index == null || index <= 2 || index >= itemCount - 3) { - return const Offstage(); + if (index == null) { + return const Offstage(); + } + if (widget.reverse) { + index = itemCount - 4; + } else { + index = 2; + } } final message = messages[index - 2]; From b2eb51317f3abc2b18bd4655359ac788a385c85b Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Tue, 17 Aug 2021 16:17:19 +0530 Subject: [PATCH 25/32] refactor(ui): early return `Offstage` in case index is null. Signed-off-by: xsahil03x --- .../stream_chat_flutter/lib/src/message_list_view.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/message_list_view.dart b/packages/stream_chat_flutter/lib/src/message_list_view.dart index 8d83ab9d..cd9c4b45 100644 --- a/packages/stream_chat_flutter/lib/src/message_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/message_list_view.dart @@ -674,10 +674,9 @@ class _MessageListViewState extends State { index = _getBottomElementIndex(values); } - if (index == null || index <= 2 || index >= itemCount - 3) { - if (index == null) { - return const Offstage(); - } + if (index == null) return const Offstage(); + + if (index <= 2 || index >= itemCount - 3) { if (widget.reverse) { index = itemCount - 4; } else { From 49fcaf40f5fa0d229aa38f6a4a92a20fb3a6a0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Braun?= Date: Tue, 17 Aug 2021 20:15:52 +0200 Subject: [PATCH 26/32] Fix sample app link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6758b189..62358d57 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This repository contains code for our [Dart](https://dart.dev/) and [Flutter](ht Stream allows developers to rapidly deploy scalable feeds and chat messaging with an industry leading 99.999% uptime SLA guarantee. ## Sample apps and demos -Our team maintains a dedicated repository for fully-fledged sample applications and demos. Consider checking out [GetStream/flutter-samples](https://github.com/GetStream/flutter-samples) to learn more or get started by looking at our latest [Stream Chat demo](https://github.com/GetStream/flutter-samples/tree/main/stream_chat_v1). +Our team maintains a dedicated repository for fully-fledged sample applications and demos. Consider checking out [GetStream/flutter-samples](https://github.com/GetStream/flutter-samples) to learn more or get started by looking at our latest [Stream Chat demo](https://github.com/GetStream/flutter-samples/tree/main/packages/stream_chat_v1). ## Free for Makers From 84fccf2c63fb9b4ba364dc7254a6938099fe41fd Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 18 Aug 2021 12:07:27 +0200 Subject: [PATCH 27/32] fix(ui): revert wrapping ChannelPreview in a DecoratedBox because of Slidable --- .../lib/src/channel_list_view.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/channel_list_view.dart b/packages/stream_chat_flutter/lib/src/channel_list_view.dart index eadbed59..d6cd454b 100644 --- a/packages/stream_chat_flutter/lib/src/channel_list_view.dart +++ b/packages/stream_chat_flutter/lib/src/channel_list_view.dart @@ -584,11 +584,16 @@ class _ChannelListViewState extends State { ), ], child: widget.channelPreviewBuilder?.call(context, channel) ?? - ChannelPreview( - onLongPress: widget.onChannelLongPress, - channel: channel, - onImageTap: () => widget.onImageTap?.call(channel), - onTap: (channel) => onTap(channel, widget.channelWidget), + DecoratedBox( + decoration: BoxDecoration( + color: chatThemeData.channelListViewTheme.backgroundColor, + ), + child: ChannelPreview( + onLongPress: widget.onChannelLongPress, + channel: channel, + onImageTap: () => widget.onImageTap?.call(channel), + onTap: (channel) => onTap(channel, widget.channelWidget), + ), ), ), ); From 819abd091e418117b3f052ea77c345bdbc25dc10 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 19 Aug 2021 11:43:25 +0200 Subject: [PATCH 28/32] fix format --- .../lib/src/stream_chat_localizations_hi.dart | 4 ++-- .../lib/src/stream_chat_localizations_ja.dart | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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 11d7d486..247b90f8 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 @@ -340,10 +340,10 @@ class StreamChatLocalizationsHi extends GlobalStreamChatLocalizations { String get sendLabel => 'भेजें'; @override - String get withText => 'विद';//TODO: break? + String get withText => 'विद'; //TODO: break? @override - String get inText => 'इन';//TODO: break? + String get inText => 'इन'; //TODO: break? @override String get youText => 'आप'; 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 e8d9759e..5510a2d8 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 @@ -85,8 +85,7 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { String get emptyChatMessagesText => 'チャットがありませんが。。。'; @override - String threadSeparatorText(int replyCount)=> '$replyCount件の返信'; - + String threadSeparatorText(int replyCount) => '$replyCount件の返信'; @override String get connectedLabel => '接続しています'; From a93b585d61e75b5b7675fbb6a9c1a9dbbf86af91 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 19 Aug 2021 11:44:23 +0200 Subject: [PATCH 29/32] fix analysis --- .../lib/src/stream_chat_localizations_ja.dart | 3 ++- .../lib/src/stream_chat_localizations_ko.dart | 15 +++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) 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 5510a2d8..f61fcc4f 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 @@ -331,7 +331,8 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { @override String get youText => 'あなた'; - // This is the word for 'customer' or 'user' because saying 'you' directly is too informal and rude + // This is the word for 'customer' or 'user' because saying 'you' directly + //is too informal and rude @override String galleryPaginationText({ 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 dbd9609d..5cc278f7 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 @@ -85,9 +85,7 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get emptyChatMessagesText => '아직 채팅이 없습니다...'; @override - String threadSeparatorText(int replyCount) { - return '$replyCount개의 답장'; - } + String threadSeparatorText(int replyCount) => '$replyCount개의 답장'; @override String get connectedLabel => '연결중'; @@ -283,14 +281,10 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { String get tryAgainLabel => '다시 시도합니다'; @override - String membersCountText(int count) { - return '$count명'; - } + String membersCountText(int count) => '$count명'; @override - String watchersCountText(int count) { - return '$count명이 온라인'; - } + String watchersCountText(int count) => '$count명이 온라인'; @override String get viewInfoLabel => '정보를 보기'; @@ -336,7 +330,8 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { @override String get youText => '당신'; - // This is the word for 'customer' or 'user' because saying 'you' directly is too informal and rude + // This is the word for 'customer' or 'user' because saying 'you' directly + // is too informal and rude @override String galleryPaginationText( From 894802502a82d03a46c579c046eaffb97725e901 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 19 Aug 2021 12:16:55 +0200 Subject: [PATCH 30/32] update readme and example --- packages/stream_chat_localizations/README.md | 6 ++++++ .../stream_chat_localizations/example/lib/add_new_lang.dart | 3 +++ packages/stream_chat_localizations/example/lib/main.dart | 3 +++ .../example/lib/override_lang.dart | 3 +++ 4 files changed, 15 insertions(+) diff --git a/packages/stream_chat_localizations/README.md b/packages/stream_chat_localizations/README.md index c2ea8a72..131d6b13 100644 --- a/packages/stream_chat_localizations/README.md +++ b/packages/stream_chat_localizations/README.md @@ -35,6 +35,8 @@ At the moment we support the following languages: - [Italian](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_it.dart) - [French](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_fr.dart) - [Spanish](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart) +- [Japanese](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart) +- [Korean](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart) More languages will be added in the future. Feel free to [contribute](https://github.com/GetStream/stream-chat-flutter/blob/master/CONTRIBUTING.md) to add more languages. @@ -70,6 +72,8 @@ class MyApp extends StatelessWidget { Locale('fr'), Locale('it'), Locale('es'), + Locale('ja'), + Locale('ko'), ], // Add GlobalStreamChatLocalizations.delegates localizationsDelegates: GlobalStreamChatLocalizations.delegates, @@ -113,6 +117,8 @@ Example: fr it es + ja + ko ``` 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 2f373691..a64717d3 100644 --- a/packages/stream_chat_localizations/example/lib/add_new_lang.dart +++ b/packages/stream_chat_localizations/example/lib/add_new_lang.dart @@ -456,6 +456,9 @@ class MyApp extends StatelessWidget { Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), + Locale('ja'), + Locale('ko'), // Add support for additional 'nn' locale Locale('nn'), ], diff --git a/packages/stream_chat_localizations/example/lib/main.dart b/packages/stream_chat_localizations/example/lib/main.dart index 818086df..76194992 100644 --- a/packages/stream_chat_localizations/example/lib/main.dart +++ b/packages/stream_chat_localizations/example/lib/main.dart @@ -73,6 +73,9 @@ class MyApp extends StatelessWidget { Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), + Locale('ja'), + Locale('ko'), ], // Add GlobalStreamChatLocalizations.delegates localizationsDelegates: GlobalStreamChatLocalizations.delegates, diff --git a/packages/stream_chat_localizations/example/lib/override_lang.dart b/packages/stream_chat_localizations/example/lib/override_lang.dart index 0e45019a..8eafd257 100644 --- a/packages/stream_chat_localizations/example/lib/override_lang.dart +++ b/packages/stream_chat_localizations/example/lib/override_lang.dart @@ -98,6 +98,9 @@ class MyApp extends StatelessWidget { Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), + Locale('ja'), + Locale('ko'), ], // Add overridden "CustomStreamChatLocalizationsEn.delegate" along with // "GlobalStreamChatLocalizations.delegates" From 5bda5db70599e8ef4d402264cf04e518c83a8f33 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Thu, 19 Aug 2021 12:17:56 +0200 Subject: [PATCH 31/32] update changelog --- packages/stream_chat_localizations/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 865741c4..a1ae75b0 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -1,6 +1,8 @@ ## Upcoming * Added support for [Spanish](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart) locale. +* Added support for [Korean](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ko.dart) locale. +* Added support for [Japanese](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_ja.dart) locale. ## 1.0.2 From 5ecbfa4ac8248fb10595eee4a86c7c071c1310ab Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 20 Aug 2021 10:21:13 +0200 Subject: [PATCH 32/32] move comments --- .../lib/src/stream_chat_localizations_ja.dart | 4 ++-- .../lib/src/stream_chat_localizations_ko.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 f61fcc4f..e6946125 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 @@ -329,10 +329,10 @@ class StreamChatLocalizationsJa extends GlobalStreamChatLocalizations { @override String get inText => 'に'; - @override - String get youText => 'あなた'; // This is the word for 'customer' or 'user' because saying 'you' directly //is too informal and rude + @override + String get youText => 'あなた'; @override String galleryPaginationText({ 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 5cc278f7..2642b991 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 @@ -328,10 +328,10 @@ class StreamChatLocalizationsKo extends GlobalStreamChatLocalizations { @override String get inText => '에'; - @override - String get youText => '당신'; // This is the word for 'customer' or 'user' because saying 'you' directly // is too informal and rude + @override + String get youText => '당신'; @override String galleryPaginationText(