chore: minor fixes, add support for "hi" locale

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2021-07-20 18:09:12 +05:30
committed by xsahil03x
parent 5f7b3ffae8
commit 2b36f009c2
10 changed files with 403 additions and 35 deletions
@@ -1,11 +1,14 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:jiffy/jiffy.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart'
show StreamChatLocalizations, User;
part 'stream_chat_localizations_en.dart';
part 'stream_chat_localizations_hi.dart';
/// The set of supported languages, as language code strings.
///
/// The [GlobalStreamChatLocalizations.delegate] can generate localizations for
@@ -14,7 +17,7 @@ part 'stream_chat_localizations_en.dart';
/// See also:
///
/// * [getStreamChatTranslation], whose documentation describes these values.
const kStreamChatSupportedLanguages = {'en'};
const kStreamChatSupportedLanguages = {'en', 'hi'};
/// Creates a [GlobalStreamChatLocalizations] instance for the given `locale`.
///
@@ -38,6 +41,8 @@ GlobalStreamChatLocalizations? getStreamChatTranslation(Locale locale) {
switch (locale.languageCode) {
case 'en':
return const StreamChatLocalizationsEn();
case 'hi':
return const StreamChatLocalizationsHi();
}
}