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
aa450d56
Unverified
Commit
aa450d56
authored
May 07, 2019
by
xster
Committed by
GitHub
May 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cupertino localization step 9: add tests (#29954)
parent
eb996afa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
107 additions
and
0 deletions
+107
-0
flutter_localizations.dart
...ages/flutter_localizations/lib/flutter_localizations.dart
+2
-0
translations_test.dart
...utter_localizations/test/cupertino/translations_test.dart
+105
-0
date_picker_test.dart
...flutter_localizations/test/material/date_picker_test.dart
+0
-0
date_time_test.dart
...s/flutter_localizations/test/material/date_time_test.dart
+0
-0
time_picker_test.dart
...flutter_localizations/test/material/time_picker_test.dart
+0
-0
translations_test.dart
...lutter_localizations/test/material/translations_test.dart
+0
-0
No files found.
packages/flutter_localizations/lib/flutter_localizations.dart
View file @
aa450d56
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
/// Localizations for the Flutter library
/// Localizations for the Flutter library
library
flutter_localizations
;
library
flutter_localizations
;
export
'src/cupertino_localizations.dart'
;
export
'src/l10n/generated_cupertino_localizations.dart'
;
export
'src/l10n/generated_material_localizations.dart'
;
export
'src/l10n/generated_material_localizations.dart'
;
export
'src/material_localizations.dart'
;
export
'src/material_localizations.dart'
;
export
'src/widgets_localizations.dart'
;
export
'src/widgets_localizations.dart'
;
packages/flutter_localizations/test/cupertino/translations_test.dart
0 → 100644
View file @
aa450d56
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter/cupertino.dart'
;
import
'package:flutter_localizations/flutter_localizations.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
void
main
(
)
{
for
(
String
language
in
kCupertinoSupportedLanguages
)
{
testWidgets
(
'translations exist for
$language
'
,
(
WidgetTester
tester
)
async
{
final
Locale
locale
=
Locale
(
language
);
expect
(
GlobalCupertinoLocalizations
.
delegate
.
isSupported
(
locale
),
isTrue
);
final
CupertinoLocalizations
localizations
=
await
GlobalCupertinoLocalizations
.
delegate
.
load
(
locale
);
expect
(
localizations
.
datePickerYear
(
0
),
isNotNull
);
expect
(
localizations
.
datePickerYear
(
1
),
isNotNull
);
expect
(
localizations
.
datePickerYear
(
2
),
isNotNull
);
expect
(
localizations
.
datePickerYear
(
10
),
isNotNull
);
expect
(
localizations
.
datePickerMonth
(
1
),
isNotNull
);
expect
(
localizations
.
datePickerMonth
(
2
),
isNotNull
);
expect
(
localizations
.
datePickerMonth
(
11
),
isNotNull
);
expect
(
localizations
.
datePickerMonth
(
12
),
isNotNull
);
expect
(
localizations
.
datePickerDayOfMonth
(
0
),
isNotNull
);
expect
(
localizations
.
datePickerDayOfMonth
(
1
),
isNotNull
);
expect
(
localizations
.
datePickerDayOfMonth
(
2
),
isNotNull
);
expect
(
localizations
.
datePickerDayOfMonth
(
10
),
isNotNull
);
expect
(
localizations
.
datePickerMediumDate
(
DateTime
(
2019
,
3
,
25
)),
isNotNull
);
expect
(
localizations
.
datePickerHour
(
0
),
isNotNull
);
expect
(
localizations
.
datePickerHour
(
1
),
isNotNull
);
expect
(
localizations
.
datePickerHour
(
2
),
isNotNull
);
expect
(
localizations
.
datePickerHour
(
10
),
isNotNull
);
expect
(
localizations
.
datePickerHourSemanticsLabel
(
0
),
isNotNull
);
expect
(
localizations
.
datePickerHourSemanticsLabel
(
1
),
isNotNull
);
expect
(
localizations
.
datePickerHourSemanticsLabel
(
2
),
isNotNull
);
expect
(
localizations
.
datePickerHourSemanticsLabel
(
10
),
isNotNull
);
expect
(
localizations
.
datePickerHourSemanticsLabel
(
0
),
isNot
(
contains
(
r'$hour'
)));
expect
(
localizations
.
datePickerHourSemanticsLabel
(
1
),
isNot
(
contains
(
r'$hour'
)));
expect
(
localizations
.
datePickerHourSemanticsLabel
(
2
),
isNot
(
contains
(
r'$hour'
)));
expect
(
localizations
.
datePickerHourSemanticsLabel
(
10
),
isNot
(
contains
(
r'$hour'
)));
expect
(
localizations
.
datePickerDateOrder
,
isNotNull
);
expect
(
localizations
.
datePickerDateTimeOrder
,
isNotNull
);
expect
(
localizations
.
anteMeridiemAbbreviation
,
isNotNull
);
expect
(
localizations
.
postMeridiemAbbreviation
,
isNotNull
);
expect
(
localizations
.
alertDialogLabel
,
isNotNull
);
expect
(
localizations
.
timerPickerHour
(
0
),
isNotNull
);
expect
(
localizations
.
timerPickerHour
(
1
),
isNotNull
);
expect
(
localizations
.
timerPickerHour
(
2
),
isNotNull
);
expect
(
localizations
.
timerPickerHour
(
10
),
isNotNull
);
expect
(
localizations
.
timerPickerMinute
(
0
),
isNotNull
);
expect
(
localizations
.
timerPickerMinute
(
1
),
isNotNull
);
expect
(
localizations
.
timerPickerMinute
(
2
),
isNotNull
);
expect
(
localizations
.
timerPickerMinute
(
10
),
isNotNull
);
expect
(
localizations
.
timerPickerSecond
(
0
),
isNotNull
);
expect
(
localizations
.
timerPickerSecond
(
1
),
isNotNull
);
expect
(
localizations
.
timerPickerSecond
(
2
),
isNotNull
);
expect
(
localizations
.
timerPickerSecond
(
10
),
isNotNull
);
expect
(
localizations
.
timerPickerHourLabel
(
0
),
isNotNull
);
expect
(
localizations
.
timerPickerHourLabel
(
1
),
isNotNull
);
expect
(
localizations
.
timerPickerHourLabel
(
2
),
isNotNull
);
expect
(
localizations
.
timerPickerHourLabel
(
10
),
isNotNull
);
expect
(
localizations
.
timerPickerMinuteLabel
(
0
),
isNotNull
);
expect
(
localizations
.
timerPickerMinuteLabel
(
1
),
isNotNull
);
expect
(
localizations
.
timerPickerMinuteLabel
(
2
),
isNotNull
);
expect
(
localizations
.
timerPickerMinuteLabel
(
10
),
isNotNull
);
expect
(
localizations
.
timerPickerSecondLabel
(
0
),
isNotNull
);
expect
(
localizations
.
timerPickerSecondLabel
(
1
),
isNotNull
);
expect
(
localizations
.
timerPickerSecondLabel
(
2
),
isNotNull
);
expect
(
localizations
.
timerPickerSecondLabel
(
10
),
isNotNull
);
expect
(
localizations
.
cutButtonLabel
,
isNotNull
);
expect
(
localizations
.
copyButtonLabel
,
isNotNull
);
expect
(
localizations
.
pasteButtonLabel
,
isNotNull
);
expect
(
localizations
.
selectAllButtonLabel
,
isNotNull
);
});
}
testWidgets
(
'Spot check French'
,
(
WidgetTester
tester
)
async
{
const
Locale
locale
=
Locale
.
fromSubtags
(
languageCode:
'fr'
,
scriptCode:
null
,
countryCode:
null
);
expect
(
GlobalCupertinoLocalizations
.
delegate
.
isSupported
(
locale
),
isTrue
);
final
CupertinoLocalizations
localizations
=
await
GlobalCupertinoLocalizations
.
delegate
.
load
(
locale
);
expect
(
localizations
is
CupertinoLocalizationFr
,
true
);
expect
(
localizations
.
alertDialogLabel
,
'Alerte'
);
expect
(
localizations
.
datePickerHourSemanticsLabel
(
1
),
'une heure'
);
expect
(
localizations
.
pasteButtonLabel
,
'Coller'
);
expect
(
localizations
.
datePickerDateOrder
,
DatePickerDateOrder
.
dmy
);
expect
(
localizations
.
timerPickerSecondLabel
(
20
),
's'
);
expect
(
localizations
.
selectAllButtonLabel
,
'Tout sélect.'
);
expect
(
localizations
.
timerPickerMinute
(
10
),
'10'
);
});
}
packages/flutter_localizations/test/date_picker_test.dart
→
packages/flutter_localizations/test/
material/
date_picker_test.dart
View file @
aa450d56
File moved
packages/flutter_localizations/test/date_time_test.dart
→
packages/flutter_localizations/test/
material/
date_time_test.dart
View file @
aa450d56
File moved
packages/flutter_localizations/test/time_picker_test.dart
→
packages/flutter_localizations/test/
material/
time_picker_test.dart
View file @
aa450d56
File moved
packages/flutter_localizations/test/translations_test.dart
→
packages/flutter_localizations/test/
material/
translations_test.dart
View file @
aa450d56
File moved
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