21 lines
890 B
Dart
21 lines
890 B
Dart
import 'package:base_project/l10n/app_localizations.dart';
|
|||
|
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
test('English and Hindi catalogs expose the same essential messages', () {
|
||
|
|
final english = AppLocalizations(const Locale('en'));
|
||
|
|
final hindi = AppLocalizations(const Locale('hi'));
|
||
|
|
|
||
|
|
expect(english.searchEntity('student'), 'Search student...');
|
||
|
|
expect(hindi.searchEntity('छात्र'), 'छात्र खोजें...');
|
||
|
|
expect(english.entityRequired('Email'), 'Email is required');
|
||
|
|
expect(hindi.entityRequired('ईमेल'), 'ईमेल आवश्यक है');
|
||
|
|
});
|
||
|
|
|
||
|
|
test('only configured locales are supported', () {
|
||
|
|
expect(AppLocalizations.supportedLocales, contains(const Locale('en')));
|
||
|
|
expect(AppLocalizations.supportedLocales, contains(const Locale('hi')));
|
||
|
|
});
|
||
|
|
}
|