Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
f14397ae
Unverified
Commit
f14397ae
authored
Mar 08, 2018
by
Hans Muller
Committed by
GitHub
Mar 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct DefaultMaterialLocalizations.delegate supported locales list (#15260)
parent
ea155df9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
material_localizations.dart
...flutter_localizations/lib/src/material_localizations.dart
+13
-2
translations_test.dart
packages/flutter_localizations/test/translations_test.dart
+5
-0
No files found.
packages/flutter_localizations/lib/src/material_localizations.dart
View file @
f14397ae
...
...
@@ -14,6 +14,10 @@ import 'l10n/date_localizations.dart' as date_localizations;
import
'l10n/localizations.dart'
show
TranslationBundle
,
translationBundleForLocale
;
import
'widgets_localizations.dart'
;
// Watch out: the supported locales list in the doc comment below must be kept
// in sync with the list we test, see test/translations_test.dart, and of course
// the acutal list of supported locales in _MaterialLocalizationsDelegate.
/// Localized strings for the material widgets.
///
/// To include the localizations provided by this class in a [MaterialApp],
...
...
@@ -493,22 +497,29 @@ void _loadDateIntlDataIfNotLoaded() {
class
_MaterialLocalizationsDelegate
extends
LocalizationsDelegate
<
MaterialLocalizations
>
{
const
_MaterialLocalizationsDelegate
();
// Watch out: this list must match the one in the GlobalMaterialLocalizations
// class doc and the list we test, see test/translations_test.dart.
static
const
List
<
String
>
_supportedLanguages
=
const
<
String
>[
'ar'
,
// Arabic
'de'
,
// German
'en'
,
// English
'es'
,
// Spanish
'fa'
,
// Farsi
'fa'
,
// Farsi
(Persian)
'fr'
,
// French
'he'
,
// Hebrew
'it'
,
// Italian
'ja'
,
// Japanese
'ko'
,
// Korean
'nl'
,
// Dutch
'pl'
,
// Polish
'ps'
,
// Pashto
'pt'
,
// Portugese
'ro'
,
// Romanian
'ru'
,
// Russian
'th'
,
// Thai
'tr'
,
// Turkish
'ur'
,
// Urdu
'zh'
,
//
Simplified Chinese
'zh'
,
//
Chinese (simplified)
];
@override
...
...
packages/flutter_localizations/test/translations_test.dart
View file @
f14397ae
...
...
@@ -7,6 +7,8 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
// Watch out: this list must be kept in sync with the comment at the top of
// GlobalMaterialLocalizations.
final
List
<
String
>
languages
=
<
String
>[
'ar'
,
// Arabic
'de'
,
// German
...
...
@@ -33,6 +35,9 @@ void main() {
for
(
String
language
in
languages
)
{
testWidgets
(
'translations exist for
$language
'
,
(
WidgetTester
tester
)
async
{
final
Locale
locale
=
new
Locale
(
language
,
''
);
expect
(
GlobalMaterialLocalizations
.
delegate
.
isSupported
(
locale
),
isTrue
);
final
MaterialLocalizations
localizations
=
new
GlobalMaterialLocalizations
(
locale
);
expect
(
localizations
.
openAppDrawerTooltip
,
isNotNull
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment