From 255fc50510d79ec01d24950fa3e6f5c7684fa3ed Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Thu, 29 Jul 2021 15:22:34 -0400 Subject: [PATCH 01/11] support spanish --- .../lib/src/stream_chat_localizations.dart | 11 +- .../lib/src/stream_chat_localizations_es.dart | 364 ++++++++++++++++++ 2 files changed, 369 insertions(+), 6 deletions(-) create mode 100644 packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.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 f98932b5..d388059d 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:stream_chat_flutter/stream_chat_flutter.dart'; +part 'stream_chat_localizations_es.dart'; + part 'stream_chat_localizations_en.dart'; part 'stream_chat_localizations_fr.dart'; @@ -19,12 +21,7 @@ part 'stream_chat_localizations_hi.dart'; /// See also: /// /// * [getStreamChatTranslation], whose documentation describes these values. -const kStreamChatSupportedLanguages = { - 'en', - 'hi', - 'fr', - 'it', -}; +const kStreamChatSupportedLanguages = {'en', 'hi', 'fr', 'it', 'es'}; /// Creates a [GlobalStreamChatLocalizations] instance for the given `locale`. /// @@ -54,6 +51,8 @@ GlobalStreamChatLocalizations? getStreamChatTranslation(Locale locale) { return const StreamChatLocalizationsFr(); case 'it': return const StreamChatLocalizationsIt(); + case 'es': + return const StreamChatLocalizationsEs(); } } 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 new file mode 100644 index 00000000..a3387c83 --- /dev/null +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations_es.dart @@ -0,0 +1,364 @@ +part of 'stream_chat_localizations.dart'; + +/// The translations for French (`fr`). +class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { + /// Create an instance of the translation bundle for French. + const StreamChatLocalizationsEs({String localeName = 'es'}) + : super(localeName: localeName); + + @override + String get launchUrlError => 'No se puede lanzar la url'; + + @override + String get loadingUsersError => 'Error de carga del usuario'; + + @override + String get noUsersLabel => 'No hay usuarios actualmente'; + + @override + String get retryLabel => 'Inténtalo de nuevo'; + + @override + String get userLastOnlineText => 'Última vez en línea'; + + @override + String get userOnlineText => 'En línea'; + + @override + String userTypingText(Iterable users) { + if (users.isEmpty) return ''; + final first = users.first; + if (users.length == 1) { + return '${first.name} está escribiendo'; + } + return '${first.name} y ${users.length - 1} están escribiendo'; + } + + @override + String get threadReplyLabel => 'Responder al hilo de discusión'; + + @override + String get onlyVisibleToYouText => 'Sólo visible para usted'; + + @override + String threadReplyCountText(int count) => + '$count Respuestas al hilo de discusión'; + + @override + String attachmentsUploadProgressText({ + required int remaining, + required int total, + }) => + 'Transferencia en curso $remaining/$total ...'; + + @override + String pinnedByUserText({ + required User pinnedBy, + required User currentUser, + }) { + final pinnedByCurrentUser = currentUser.id == pinnedBy.id; + if (pinnedByCurrentUser) return 'Fijado por ti'; + return 'Fijado por ${pinnedBy.name}'; + } + + @override + String get emptyMessagesText => 'Actualmente no hay mensajes'; + + @override + String get genericErrorText => 'Hubo un problema'; + + @override + String get loadingMessagesError => 'Mensajes de error de carga'; + + @override + String resultCountText(int count) => '$count resultados'; + + @override + String get messageDeletedText => 'Este mensaje ha sido borrado.'; + + @override + String get messageDeletedLabel => 'Mensaje borrado'; + + @override + String get messageReactionsLabel => 'Reacciones a los mensajes'; + + @override + String get emptyChatMessagesText => 'Todavía no hay charlas aquí...'; + + @override + String threadSeparatorText(int replyCount) { + if (replyCount == 1) return '1 Respuesta'; + return '$replyCount Respuestas'; + } + + @override + String get connectedLabel => 'Conectado'; + + @override + String get disconnectedLabel => 'Desconectado'; + + @override + String get reconnectingLabel => 'Reconectando...'; + + @override + String get alsoSendAsDirectMessageLabel => + 'Enviar también como mensaje directo'; + + @override + String get addACommentOrSendLabel => 'Añadir un comentario o enviar'; + + @override + String get searchGifLabel => 'Búsqueda de GIFs'; + + @override + String get writeAMessageLabel => 'Escribir un mensaje'; + + @override + String get instantCommandsLabel => 'Mandos instantáneos'; + + @override + String fileTooLargeAfterCompressionError(double limitInMB) => + 'El archivo es demasiado grande para descargarlo. ' + 'El tamaño máximo del archivo es de $limitInMB MB. ' + 'Intentamos comprimirlo, pero no fue suficiente.'; + + @override + String fileTooLargeError(double limitInMB) => + 'El archivo es demasiado grande para descargarlo. ' + 'El límite de tamaño de los archivos es de $limitInMB MB.'; + + @override + String emojiMatchingQueryText(String query) => + 'Emoji que corresponde a "$query"'; + + @override + String get addAFileLabel => 'Añadir un archivo'; + + @override + String get photoFromCameraLabel => 'Foto de la cámara'; + + @override + String get uploadAFileLabel => 'Transferir un archivo'; + + @override + String get uploadAPhotoLabel => 'Subir una foto'; + + @override + String get uploadAVideoLabel => 'Subir una vídeo'; + + @override + String get videoFromCameraLabel => 'Vídeo de la cámara'; + + @override + String get okLabel => 'Vale'; + + @override + String get somethingWentWrongError => 'Algo ha salido mal'; + + @override + String get addMoreFilesLabel => 'Añadir más archivos'; + + @override + String get enablePhotoAndVideoAccessMessage => + 'Por favor, permita el acceso a sus fotos' + '\ny vídeos para que puedas compartirlos con sus amigos.'; + + @override + String get allowGalleryAccessMessage => 'Permitir el acceso a su galería'; + + @override + String get flagMessageLabel => 'Reportar un mensaje'; + + @override + String get flagMessageQuestion => + '¿Quiere enviar una copia de este mensaje a un' + '\nmoderador para una mayor investigación?'; + + @override + String get flagLabel => 'REPORTAR'; + + @override + String get cancelLabel => 'CANCELAR'; + + @override + String get flagMessageSuccessfulLabel => 'Mensaje reportado'; + + @override + String get flagMessageSuccessfulText => + 'Este mensaje ha sido reportado a un moderador.'; + + @override + String get deleteLabel => 'BORRAR'; + + @override + String get deleteMessageLabel => 'Borrar el mensaje'; + + @override + String get deleteMessageQuestion => + '¿Estás seguro de que quieres borrar este\nmensaje de forma permanente?'; + + @override + String get operationCouldNotBeCompletedText => + 'La operación no pudo completarse.'; + + @override + String get replyLabel => 'Respuesta'; + + @override + String togglePinUnpinText({required bool pinned}) { + if (pinned) return 'Desfijar a la conversación'; + return 'Fijar a la conversación'; + } + + @override + String toggleDeleteRetryDeleteMessageText({required bool isDeleteFailed}) { + if (isDeleteFailed) return 'Reintentar borrar el mensaje'; + return 'Borrar el mensaje'; + } + + @override + String get copyMessageLabel => 'Copiar el mensaje'; + + @override + String get editMessageLabel => 'Editar el mensaje'; + + @override + String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) { + if (isUpdateFailed) return 'Reenviar el mensaje modificado'; + return 'Enviar de vuelta'; + } + + @override + String get photosLabel => 'Fotos'; + + 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 'hoy'; + } else if (date == yesterday) { + return 'ayer'; + } else { + return 'el ${Jiffy(date).MMMd}'; + } + } + + @override + String sentAtText({required DateTime date, required DateTime time}) => + 'Enviado ${_getDay(date)} a ${Jiffy(time.toLocal()).format('HH:mm')}'; + + @override + String get todayLabel => 'Hoy'; + + @override + String get yesterdayLabel => 'Ayer'; + + @override + String get channelIsMutedText => 'El canal está cortado'; + + @override + String get noTitleText => 'Sin título'; + + @override + String get letsStartChattingLabel => '¡Empecemos a charlar!'; + + @override + String get sendingFirstMessageLabel => + '¿Qué le parece enviar su primer mensaje a un amigo?'; + + @override + String get startAChatLabel => 'Iniciar una discusión'; + + @override + String get loadingChannelsError => 'Error al cargar los canales'; + + @override + String get deleteConversationLabel => 'Borrar la conversación'; + + @override + String get deleteConversationQuestion => + '¿Estás seguro de que quieres borrar esta conversación?'; + + @override + String get streamChatLabel => 'Stream Chat'; + + @override + String get searchingForNetworkText => 'Búsqueda en la red'; + + @override + String get offlineLabel => 'Sin conexión...'; + + @override + String get tryAgainLabel => 'Inténtalo de nuevo'; + + @override + String membersCountText(int count) { + if (count == 1) return '1 Membre'; + return '$count Membres'; + } + + @override + String watchersCountText(int count) { + if (count == 1) return '1 En línea'; + return '$count En línea'; + } + + @override + String get viewInfoLabel => 'Ver información'; + + @override + String get leaveGroupLabel => 'Dejar el Grupo'; + + @override + String get leaveLabel => 'DEJAR'; + + @override + String get leaveConversationLabel => 'Dejar la conversación'; + + @override + String get leaveConversationQuestion => + '¿Estás seguro de que quieres dejar esta conversación?'; + + @override + String get showInChatLabel => 'Mostrar en el chat'; + + @override + String get saveImageLabel => 'Guardar la imagen'; + + @override + String get saveVideoLabel => 'Guardar el vídeo'; + + @override + String get uploadErrorLabel => 'ERROR DE TRANSFERENCIA'; + + @override + String get giphyLabel => 'Giphy'; + + @override + String get shuffleLabel => 'Mezclar'; + + @override + String get sendLabel => 'Enviar'; + + @override + String get withText => 'con'; + + @override + String get inText => 'en'; + + @override + String get youText => 'Usted'; + + @override + String get ofText => 'de'; + + @override + String get fileText => 'Archivo'; + + @override + String get replyToMessageLabel => 'Responder al Mensaje'; +} From d54bb5406a3edb8da201fe469d9210e603c9fa70 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Thu, 29 Jul 2021 15:22:44 -0400 Subject: [PATCH 02/11] fix some typos in french translations --- .../lib/src/stream_chat_localizations_fr.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 1bbfbc5a..9d8586d5 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 @@ -31,7 +31,7 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { if (users.length == 1) { return "${first.name} est en train d'écrire"; } - return "${first.name} and ${users.length - 1} sont entrain d'écrire"; + return "${first.name} et ${users.length - 1} sont entrain d'écrire"; } @override @@ -49,7 +49,7 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { required int remaining, required int total, }) => - 'Uploading $remaining/$total ...'; + 'Transfert en cours $remaining/$total ...'; @override String pinnedByUserText({ @@ -206,8 +206,8 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { @override String togglePinUnpinText({required bool pinned}) { - if (pinned) return 'Détacher de la conversation'; - return 'Attacher à la conversation'; + if (pinned) return 'Décrocher de la conversation'; + return 'Épingler à la discussion'; } @override @@ -311,7 +311,7 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { String get viewInfoLabel => 'Voir les informations'; @override - String get leaveGroupLabel => 'Quitter le Group'; + String get leaveGroupLabel => 'Quitter le Groupe'; @override String get leaveLabel => 'QUITTER'; @@ -324,7 +324,7 @@ class StreamChatLocalizationsFr extends GlobalStreamChatLocalizations { 'Etes-vous sûr de vouloir quitter cette conversation ?'; @override - String get showInChatLabel => 'Montrer dans le Chat'; + String get showInChatLabel => 'Montrer dans la Discussion'; @override String get saveImageLabel => "Sauvegarder l'image"; From 462f9c8f0538837a6a0e9459a2c1effed97d757a Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Thu, 29 Jul 2021 15:51:45 -0400 Subject: [PATCH 03/11] fix docs: typo mentioning french --- .../lib/src/stream_chat_localizations_es.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 a3387c83..424d95e2 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 @@ -1,8 +1,8 @@ part of 'stream_chat_localizations.dart'; -/// The translations for French (`fr`). +/// The translations for Spanish (`es`). class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { - /// Create an instance of the translation bundle for French. + /// Create an instance of the translation bundle for Spanish. const StreamChatLocalizationsEs({String localeName = 'es'}) : super(localeName: localeName); From b05a822d601a6bc42cad20e80c56a7a2ba3e37db Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Fri, 30 Jul 2021 10:54:20 +0200 Subject: [PATCH 04/11] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jc Miñarro --- .../lib/src/stream_chat_localizations_es.dart | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) 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 424d95e2..75bed1e3 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 @@ -7,7 +7,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { : super(localeName: localeName); @override - String get launchUrlError => 'No se puede lanzar la url'; + String get launchUrlError => 'No se pudo abrir la url'; @override String get loadingUsersError => 'Error de carga del usuario'; @@ -16,7 +16,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get noUsersLabel => 'No hay usuarios actualmente'; @override - String get retryLabel => 'Inténtalo de nuevo'; + String get retryLabel => 'Inténtelo de nuevo'; @override String get userLastOnlineText => 'Última vez en línea'; @@ -42,7 +42,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String threadReplyCountText(int count) => - '$count Respuestas al hilo de discusión'; + '$count respuestas al hilo de discusión'; @override String attachmentsUploadProgressText({ @@ -68,7 +68,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get genericErrorText => 'Hubo un problema'; @override - String get loadingMessagesError => 'Mensajes de error de carga'; + String get loadingMessagesError => 'Hubo un error mientras se cargaba el mensaje'; @override String resultCountText(int count) => '$count resultados'; @@ -87,8 +87,8 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String threadSeparatorText(int replyCount) { - if (replyCount == 1) return '1 Respuesta'; - return '$replyCount Respuestas'; + if (replyCount == 1) return '1 respuesta'; + return '$replyCount respuestas'; } @override @@ -114,7 +114,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get writeAMessageLabel => 'Escribir un mensaje'; @override - String get instantCommandsLabel => 'Mandos instantáneos'; + String get instantCommandsLabel => 'Comandos instantáneos'; @override String fileTooLargeAfterCompressionError(double limitInMB) => @@ -225,7 +225,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String toggleResendOrResendEditedMessage({required bool isUpdateFailed}) { if (isUpdateFailed) return 'Reenviar el mensaje modificado'; - return 'Enviar de vuelta'; + return 'Reenviar'; } @override @@ -249,7 +249,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String sentAtText({required DateTime date, required DateTime time}) => - 'Enviado ${_getDay(date)} a ${Jiffy(time.toLocal()).format('HH:mm')}'; + 'Enviado el ${_getDay(date)} a las ${Jiffy(time.toLocal()).format('HH:mm')}'; @override String get todayLabel => 'Hoy'; @@ -258,7 +258,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get yesterdayLabel => 'Ayer'; @override - String get channelIsMutedText => 'El canal está cortado'; + String get channelIsMutedText => 'El canal está silenciado'; @override String get noTitleText => 'Sin título'; @@ -271,7 +271,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { '¿Qué le parece enviar su primer mensaje a un amigo?'; @override - String get startAChatLabel => 'Iniciar una discusión'; + String get startAChatLabel => 'Iniciar una conversación'; @override String get loadingChannelsError => 'Error al cargar los canales'; @@ -287,18 +287,18 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get streamChatLabel => 'Stream Chat'; @override - String get searchingForNetworkText => 'Búsqueda en la red'; + String get searchingForNetworkText => 'Buscando red'; @override String get offlineLabel => 'Sin conexión...'; @override - String get tryAgainLabel => 'Inténtalo de nuevo'; + String get tryAgainLabel => 'Inténtelo de nuevo'; @override String membersCountText(int count) { - if (count == 1) return '1 Membre'; - return '$count Membres'; + if (count == 1) return '1 miembro'; + return '$count miembros'; } @override @@ -311,17 +311,17 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { String get viewInfoLabel => 'Ver información'; @override - String get leaveGroupLabel => 'Dejar el Grupo'; + String get leaveGroupLabel => 'Salir del Grupo'; @override - String get leaveLabel => 'DEJAR'; + String get leaveLabel => 'SALIR'; @override - String get leaveConversationLabel => 'Dejar la conversación'; + String get leaveConversationLabel => 'Salir de la conversación'; @override String get leaveConversationQuestion => - '¿Estás seguro de que quieres dejar esta conversación?'; + '¿Estás seguro de que quiere salir de esta conversación?'; @override String get showInChatLabel => 'Mostrar en el chat'; From 1e778fa3d312a6add15263ab896351e1598ba27c Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 10:18:14 -0400 Subject: [PATCH 05/11] update docusaurus: adding_localization --- 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 7e6cb7e2..9eb4dd68 100644 --- a/docusaurus/docs/Flutter/guides/adding_localization.mdx +++ b/docusaurus/docs/Flutter/guides/adding_localization.mdx @@ -25,6 +25,7 @@ At the moment we support the following languages: - [Hindi](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart) - [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) 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. @@ -62,6 +63,7 @@ class MyApp extends StatelessWidget { Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), ], // Add GlobalStreamChatLocalizations.delegates localizationsDelegates: GlobalStreamChatLocalizations.delegates, @@ -130,6 +132,7 @@ Here is an example of how that would look like: Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), ], // locales are the locales of the device // supportedLocales are the app supported locales @@ -172,5 +175,6 @@ Example: nb fr it + es ``` From ab1b65846dcc39cecee75e558fd7e60e8edf79b8 Mon Sep 17 00:00:00 2001 From: Sacha Arbonel Date: Mon, 2 Aug 2021 10:19:38 -0400 Subject: [PATCH 06/11] apply review: add column --- .../lib/src/stream_chat_localizations.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 d388059d..a6a66b93 100644 --- a/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart +++ b/packages/stream_chat_localizations/lib/src/stream_chat_localizations.dart @@ -21,7 +21,13 @@ part 'stream_chat_localizations_hi.dart'; /// See also: /// /// * [getStreamChatTranslation], whose documentation describes these values. -const kStreamChatSupportedLanguages = {'en', 'hi', 'fr', 'it', 'es'}; +const kStreamChatSupportedLanguages = { + 'en', + 'hi', + 'fr', + 'it', + 'es', +}; /// Creates a [GlobalStreamChatLocalizations] instance for the given `locale`. /// From 0995f663978571808014db3ecde367e1c969edac Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 5 Aug 2021 01:07:46 +0530 Subject: [PATCH 07/11] chore(localization): fix analyzer and formatting errors Signed-off-by: Sahil Kumar --- .../lib/src/stream_chat_localizations_es.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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..b43e4ba8 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'; @@ -249,7 +250,7 @@ class StreamChatLocalizationsEs extends GlobalStreamChatLocalizations { @override String sentAtText({required DateTime date, required DateTime time}) => - 'Enviado el ${_getDay(date)} a las ${Jiffy(time.toLocal()).format('HH:mm')}'; + '''Enviado el ${_getDay(date)} a las ${Jiffy(time.toLocal()).format('HH:mm')}'''; @override String get todayLabel => 'Hoy'; From a6e96c79f6999b6e612d98615c87016872fbcc36 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 5 Aug 2021 01:08:09 +0530 Subject: [PATCH 08/11] chore(localization): update CHANGELOG.md Signed-off-by: Sahil Kumar --- packages/stream_chat_localizations/CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 4667ab93..7565224e 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -1,6 +1,10 @@ +## Upcoming + +* Added support for `Spanish ('es')` locale. + ## 1.0.2 -* Updated stream_chat_flutter dependency +* Updated `stream_chat_flutter` dependency ## 1.0.1 From 5c3a9485a454f73e36e93036f6af69c68336aec4 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 5 Aug 2021 01:24:04 +0530 Subject: [PATCH 09/11] chore(doc, ui): minor formatting changes Signed-off-by: Sahil Kumar --- docusaurus/docs/Flutter/guides/adding_localization.mdx | 2 +- packages/stream_chat_flutter/example/lib/main.dart | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docusaurus/docs/Flutter/guides/adding_localization.mdx b/docusaurus/docs/Flutter/guides/adding_localization.mdx index 9eb4dd68..c3585b1b 100644 --- a/docusaurus/docs/Flutter/guides/adding_localization.mdx +++ b/docusaurus/docs/Flutter/guides/adding_localization.mdx @@ -175,6 +175,6 @@ Example: nb fr it - es + es ``` diff --git a/packages/stream_chat_flutter/example/lib/main.dart b/packages/stream_chat_flutter/example/lib/main.dart index c2663a6a..1589c909 100644 --- a/packages/stream_chat_flutter/example/lib/main.dart +++ b/packages/stream_chat_flutter/example/lib/main.dart @@ -74,6 +74,7 @@ class MyApp extends StatelessWidget { Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), ], localizationsDelegates: GlobalStreamChatLocalizations.delegates, builder: (context, widget) => StreamChat( From 47349ae3dd18fdf08128e87fec10d77bb53512bc Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 5 Aug 2021 01:27:47 +0530 Subject: [PATCH 10/11] chore(localization): update CHANGELOG.md Signed-off-by: Sahil Kumar --- packages/stream_chat_localizations/CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_localizations/CHANGELOG.md b/packages/stream_chat_localizations/CHANGELOG.md index 7565224e..865741c4 100644 --- a/packages/stream_chat_localizations/CHANGELOG.md +++ b/packages/stream_chat_localizations/CHANGELOG.md @@ -1,6 +1,6 @@ ## Upcoming -* Added support for `Spanish ('es')` locale. +* 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. ## 1.0.2 @@ -12,4 +12,8 @@ ## 1.0.0 -* First release +* Initial Release with support for 4 locales + - [English](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_en.dart) + - [Hindi](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart) + - [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) From 984b9af1825012e2aec8c776e3dabd0f16bb3a0f Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Thu, 5 Aug 2021 01:32:30 +0530 Subject: [PATCH 11/11] chore(localization): update README.md Signed-off-by: Sahil Kumar --- packages/stream_chat_localizations/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_localizations/README.md b/packages/stream_chat_localizations/README.md index bf648e45..c2ea8a72 100644 --- a/packages/stream_chat_localizations/README.md +++ b/packages/stream_chat_localizations/README.md @@ -34,6 +34,7 @@ At the moment we support the following languages: - [Hindi](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/lib/src/stream_chat_localizations_hi.dart) - [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) 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. @@ -68,6 +69,7 @@ class MyApp extends StatelessWidget { Locale('hi'), Locale('fr'), Locale('it'), + Locale('es'), ], // Add GlobalStreamChatLocalizations.delegates localizationsDelegates: GlobalStreamChatLocalizations.delegates, @@ -86,13 +88,13 @@ class MyApp extends StatelessWidget { ### Adding a new language -To add a new language, you need to create a new class extending `GlobalStreamChatLocalizations` and create a delegate for it adding it to the `delegates` array. +To add a new language, create a new class extending `GlobalStreamChatLocalizations` and create a delegate for it, adding it to the `delegates` array. Check out [this example](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/example/lib/add_new_lang.dart) to see how to add a new language. ### Override existing languages -To override an existing language, you need to create a new class extending that particular language class and create a delegate for it adding it to the `delegates` array. +To override an existing language, create a new class extending that particular language class and create a delegate for it, adding it to the `delegates` array. Check out [this example](https://github.com/GetStream/stream-chat-flutter/blob/master/packages/stream_chat_localizations/example/lib/override_lang.dart) to see how to override an existing language. @@ -110,6 +112,7 @@ Example: nb fr it + es ```