From 1107d99076bcaa3b705a2d9bd9fca4e7997876a2 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 28 Jul 2021 12:12:31 +0200 Subject: [PATCH] update readmes --- README.md | 3 +++ packages/stream_chat_flutter/README.md | 1 - packages/stream_chat_localizations/README.md | 25 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 293f60f6..6758b189 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ This package provides business logic to fetch common things required for integra ### [stream_chat_flutter](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_flutter) This library includes both a low-level chat SDK and a set of reusable and customizable UI components. +### [stream_chat_localizations](https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_localizations) +This library includes a set of localization files for the Flutter UI components. + ## Flutter Chat Tutorial The best place to start is the [Flutter Chat Tutorial](https://getstream.io/chat/flutter/tutorial/). diff --git a/packages/stream_chat_flutter/README.md b/packages/stream_chat_flutter/README.md index 41ea079d..e79c4b42 100644 --- a/packages/stream_chat_flutter/README.md +++ b/packages/stream_chat_flutter/README.md @@ -15,7 +15,6 @@ - [Flutter Chat Tutorial](https://getstream.io/chat/flutter/tutorial/) - [Chat UI Kit](https://getstream.io/chat/ui-kit/) - ### Changelog Check out the [changelog on pub.dev](https://pub.dev/packages/stream_chat_flutter/changelog) to see the latest changes in the package. diff --git a/packages/stream_chat_localizations/README.md b/packages/stream_chat_localizations/README.md index 393a414b..49fd4442 100644 --- a/packages/stream_chat_localizations/README.md +++ b/packages/stream_chat_localizations/README.md @@ -20,7 +20,18 @@ This package provides localized strings for the stream chat widgets for many lan Check out the [changelog on pub.dev](https://pub.dev/packages/stream_chat_localizations/changelog) to see the latest changes in the package. +## Supported languages + +At the moment we support the following languages: +- [English](https://pub.dev/documentation/stream_chat_localizations/latest/stream_chat_localizations/StreamChatLocalizationsEn-class.html) +- [Hindi](https://pub.dev/documentation/stream_chat_localizations/latest/stream_chat_localizations/StreamChatLocalizationsHi-class.html) +- [Italian](https://pub.dev/documentation/stream_chat_localizations/latest/stream_chat_localizations/StreamChatLocalizationsIt-class.html) +- [French](https://pub.dev/documentation/stream_chat_localizations/latest/stream_chat_localizations/StreamChatLocalizationsFr-class.html) + +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 + Add this to your package's pubspec.yaml file, use the latest version [![Pub](https://img.shields.io/pub/v/stream_chat_localizations.svg)](https://pub.dartlang.org/packages/stream_chat_localizations) ```yaml dependencies: @@ -30,6 +41,7 @@ dependencies: You should then run `flutter packages get` ### Usage + ```dart import 'package:flutter/material.dart'; import 'package:stream_chat_localizations/stream_chat_localizations.dart'; @@ -65,7 +77,20 @@ 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. + +Checkout [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 exisiting 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. + +Checkout [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. + ### ⚠️ Note on **iOS** + For translation to work on **iOS** you need to add supported locales to `ios/Runner/Info.plist` as described [here](https://flutter.dev/docs/development/accessibility-and-localization/internationalization#specifying-supportedlocales).