Remove json translations approach, add example for adding language
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:stream_chat_localization/stream_chat_localizations.dart';
|
||||
import 'package:stream_chat_localizations/stream_chat_localizations.dart';
|
||||
|
||||
void main() {
|
||||
test('adds one to input values', () {
|
||||
final calculator = Calculator();
|
||||
expect(calculator.addOne(2), 3);
|
||||
expect(calculator.addOne(-7), -6);
|
||||
expect(calculator.addOne(0), 1);
|
||||
});
|
||||
for (final language in kStreamChatSupportedLanguages) {
|
||||
test('translations exist for $language', () async {
|
||||
final locale = Locale(language);
|
||||
expect(
|
||||
GlobalStreamChatLocalizations.delegate.isSupported(locale),
|
||||
isTrue,
|
||||
);
|
||||
final localizations =
|
||||
await GlobalStreamChatLocalizations.delegate.load(locale);
|
||||
expect(localizations.launchUrlError, isNotNull);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user