Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<string>hi</string>
<string>en</string>
<string>gu</string>
<string>raj</string>
<string>kn</string>
<string>mr</string>
</array>
Expand Down
1 change: 1 addition & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ output-localization-file: app_localizations.dart
supported-locales:
- en
- hi
- raj
untranslated-messages-file: untranslated.txt
19 changes: 11 additions & 8 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'app_localizations_gu.dart';
import 'app_localizations_hi.dart';
import 'app_localizations_kn.dart';
import 'app_localizations_mr.dart';
import 'app_localizations_raj.dart';

// ignore_for_file: type=lint

Expand Down Expand Up @@ -65,8 +66,7 @@ import 'app_localizations_mr.dart';
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());

final String localeName;

Expand All @@ -89,17 +89,18 @@ abstract class AppLocalizations {
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];

/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[
Locale('en'),
Locale('gu'),
Locale('hi'),
Locale('raj'),
Locale('kn'),
Locale('mr'),
];
Expand Down Expand Up @@ -2478,7 +2479,7 @@ class _AppLocalizationsDelegate

@override
bool isSupported(Locale locale) =>
<String>['en', 'gu', 'hi', 'kn', 'mr'].contains(locale.languageCode);
<String>['en', 'gu', 'hi', 'kn', 'mr','raj'].contains(locale.languageCode);

@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
Expand All @@ -2493,6 +2494,8 @@ AppLocalizations lookupAppLocalizations(Locale locale) {
return AppLocalizationsGu();
case 'hi':
return AppLocalizationsHi();
case 'raj':
return AppLocalizationsRaj();
case 'kn':
return AppLocalizationsKn();
case 'mr':
Expand Down
Loading