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
60c4ff93
Commit
60c4ff93
authored
Sep 07, 2017
by
Hans Muller
Committed by
GitHub
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More localizations for Material (#11989)
parent
ca7d2d23
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
566 additions
and
78 deletions
+566
-78
about.dart
packages/flutter/lib/src/material/about.dart
+4
-3
date_picker.dart
packages/flutter/lib/src/material/date_picker.dart
+3
-2
localizations.dart
packages/flutter/lib/src/material/i18n/localizations.dart
+172
-22
material_ar.arb
packages/flutter/lib/src/material/i18n/material_ar.arb
+11
-1
material_de.arb
packages/flutter/lib/src/material/i18n/material_de.arb
+12
-2
material_en.arb
packages/flutter/lib/src/material/i18n/material_en.arb
+60
-0
material_es.arb
packages/flutter/lib/src/material/i18n/material_es.arb
+11
-1
material_fa.arb
packages/flutter/lib/src/material/i18n/material_fa.arb
+11
-1
material_fr.arb
packages/flutter/lib/src/material/i18n/material_fr.arb
+12
-2
material_he.arb
packages/flutter/lib/src/material/i18n/material_he.arb
+11
-1
material_it.arb
packages/flutter/lib/src/material/i18n/material_it.arb
+11
-1
material_ja.arb
packages/flutter/lib/src/material/i18n/material_ja.arb
+13
-3
material_ps.arb
packages/flutter/lib/src/material/i18n/material_ps.arb
+11
-1
material_pt.arb
packages/flutter/lib/src/material/i18n/material_pt.arb
+11
-1
material_ru.arb
packages/flutter/lib/src/material/i18n/material_ru.arb
+11
-1
material_sd.arb
packages/flutter/lib/src/material/i18n/material_sd.arb
+12
-2
material_ur.arb
packages/flutter/lib/src/material/i18n/material_ur.arb
+11
-1
material_zh.arb
packages/flutter/lib/src/material/i18n/material_zh.arb
+14
-4
material_localizations.dart
...ages/flutter/lib/src/material/material_localizations.dart
+60
-0
stepper.dart
packages/flutter/lib/src/material/stepper.dart
+4
-2
text_selection.dart
packages/flutter/lib/src/material/text_selection.dart
+6
-4
time_picker.dart
packages/flutter/lib/src/material/time_picker.dart
+4
-2
localizations_test.dart
packages/flutter/test/material/localizations_test.dart
+42
-2
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+49
-19
No files found.
packages/flutter/lib/src/material/about.dart
View file @
60c4ff93
...
...
@@ -13,6 +13,7 @@ import 'debug.dart';
import
'dialog.dart'
;
import
'flat_button.dart'
;
import
'list_tile.dart'
;
import
'material_localizations.dart'
;
import
'page.dart'
;
import
'progress_indicator.dart'
;
import
'scaffold.dart'
;
...
...
@@ -287,7 +288,7 @@ class AboutDialog extends StatelessWidget {
),
actions:
<
Widget
>[
new
FlatButton
(
child:
const
Text
(
'VIEW LICENSES'
),
child:
new
Text
(
MaterialLocalizations
.
of
(
context
).
viewLicensesButtonLabel
),
onPressed:
()
{
showLicensePage
(
context:
context
,
...
...
@@ -299,7 +300,7 @@ class AboutDialog extends StatelessWidget {
}
),
new
FlatButton
(
child:
const
Text
(
'CLOSE'
),
child:
new
Text
(
MaterialLocalizations
.
of
(
context
).
closeButtonLabel
),
onPressed:
()
{
Navigator
.
pop
(
context
);
}
...
...
@@ -440,7 +441,7 @@ class _LicensePageState extends State<LicensePage> {
}
return
new
Scaffold
(
appBar:
new
AppBar
(
title:
const
Text
(
'Licenses'
)
title:
new
Text
(
MaterialLocalizations
.
of
(
context
).
licensesPageTitle
),
),
body:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
caption
,
...
...
packages/flutter/lib/src/material/date_picker.dart
View file @
60c4ff93
...
...
@@ -800,15 +800,16 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
child:
_buildPicker
(),
),
);
final
MaterialLocalizations
localizations
=
MaterialLocalizations
.
of
(
context
);
final
Widget
actions
=
new
ButtonTheme
.
bar
(
child:
new
ButtonBar
(
children:
<
Widget
>[
new
FlatButton
(
child:
const
Text
(
'CANCEL'
),
child:
new
Text
(
localizations
.
cancelButtonLabel
),
onPressed:
_handleCancel
,
),
new
FlatButton
(
child:
const
Text
(
'OK'
),
child:
new
Text
(
localizations
.
okButtonLabel
),
onPressed:
_handleOk
,
),
],
...
...
packages/flutter/lib/src/material/i18n/localizations.dart
View file @
60c4ff93
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/material/i18n/material_ar.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"الى الخلف"
,
"closeButtonTooltip"
:
"إغلا"
,
"nextMonthTooltip"
:
"الشهر القادم"
,
"previousMonthTooltip"
:
"الشهر الماضى"
"previousMonthTooltip"
:
"الشهر الماضى"
,
"licensesPageTitle"
:
"التّراخيص"
,
"cancelButtonLabel"
:
"إلغاء"
,
"closeButtonLabel"
:
"أغلاق"
,
"continueButtonLabel"
:
"استمر"
,
"copyButtonLabel"
:
"نسخ"
,
"cutButtonLabel"
:
"كِم جارح"
,
"okButtonLabel"
:
"حسنا"
,
"pasteButtonLabel"
:
"عجين"
,
"selectAllButtonLabel"
:
"اختر الكل"
,
"viewLicensesButtonLabel"
:
"عرض التراخيص"
}
packages/flutter/lib/src/material/i18n/material_de.arb
View file @
60c4ff93
{
"openAppDrawerTooltip"
:
"Navigationsmenü öffnen"
,
"backButtonTooltip"
:
"Zurück"
,
"closeButtonTooltip"
:
"Schließen
"
,
"closeButtonTooltip"
:
"Schließen"
,
"nextMonthTooltip"
:
"Nächster Monat"
,
"previousMonthTooltip"
:
"Letzter Monat"
"previousMonthTooltip"
:
"Vorheriger Monat"
,
"licensesPageTitle"
:
"Lizenzen"
,
"cancelButtonLabel"
:
"ABBRECHEN"
,
"closeButtonLabel"
:
"SCHLIESSEN"
,
"continueButtonLabel"
:
"FORTSETZEN"
,
"copyButtonLabel"
:
"KOPIEREN"
,
"cutButtonLabel"
:
"AUSSCHNEIDEN"
,
"okButtonLabel"
:
"OK"
,
"pasteButtonLabel"
:
"EINFÜGEN"
,
"selectAllButtonLabel"
:
"ALLES AUSWÄHLEN"
,
"viewLicensesButtonLabel"
:
"LIZENZEN ANZEIGEN"
}
packages/flutter/lib/src/material/i18n/material_en.arb
View file @
60c4ff93
...
...
@@ -27,5 +27,65 @@
"@previousMonthTooltip"
:
{
"description"
:
"The tooltip for the MonthPicker's 'previous month' button."
,
"type"
:
"text"
},
"licensesPageTitle"
:
"Licenses"
,
"@licensesPageTitle"
:
{
"description"
:
"The title for the Flutter licenses page."
,
"type"
:
"text"
},
"cancelButtonLabel"
:
"CANCEL"
,
"@cancelButtonLabel"
:
{
"description"
:
"The label for cancel buttons and menu items."
,
"type"
:
"text"
},
"closeButtonLabel"
:
"CLOSE"
,
"@closeButtonLabel"
:
{
"description"
:
"The label for close buttons and menu items."
,
"type"
:
"text"
},
"continueButtonLabel"
:
"CONTINUE"
,
"@continueButtonLabel"
:
{
"description"
:
"The label for continue buttons and menu items."
,
"type"
:
"text"
},
"copyButtonLabel"
:
"COPY"
,
"@copyButtonLabel"
:
{
"description"
:
"The label for copy buttons and menu items."
,
"type"
:
"text"
},
"cutButtonLabel"
:
"CUT"
,
"@cutButtonLabel"
:
{
"description"
:
"The label for cut buttons and menu items"
,
"type"
:
"text"
},
"okButtonLabel"
:
"OK"
,
"@okButtonLabel"
:
{
"description"
:
"The label for OK buttons and menu items."
,
"type"
:
"text"
},
"pasteButtonLabel"
:
"PASTE"
,
"@pasteButtonLabel"
:
{
"description"
:
"The label for paste buttons and menu items."
,
"type"
:
"text"
},
"selectAllButtonLabel"
:
"SELECT ALL"
,
"@selectButtonLabel"
:
{
"description"
:
"The label for select-all buttons and menu items."
,
"type"
:
"text"
},
"viewLicensesButtonLabel"
:
"VIEW LICENSES"
,
"@viewLicensesButtonLabel"
:
{
"description"
:
"The label for the about box's view licenses button."
,
"type"
:
"text"
}
}
packages/flutter/lib/src/material/i18n/material_es.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"Espalda"
,
"closeButtonTooltip"
:
"Cerrar"
,
"nextMonthTooltip"
:
"Próximo mes"
,
"previousMonthTooltip"
:
"mes anterior"
"previousMonthTooltip"
:
"Mes anterior"
,
"licensesPageTitle"
:
"Licencias"
,
"cancelButtonLabel"
:
"CANCELAR"
,
"closeButtonLabel"
:
"CERRAR"
,
"continueButtonLabel"
:
"CONTINUAR"
,
"copyButtonLabel"
:
"COPIAR"
,
"cutButtonLabel"
:
"CORTAR"
,
"okButtonLabel"
:
"OK"
,
"pasteButtonLabel"
:
"PEGAR"
,
"selectAllButtonLabel"
:
"SELECCIONAR TODO"
,
"viewLicensesButtonLabel"
:
"VER LICENCIAS"
}
packages/flutter/lib/src/material/i18n/material_fa.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"بازگشت"
,
"closeButtonTooltip"
:
"بستن"
,
"nextMonthTooltip"
:
"ماه بعد"
,
"previousMonthTooltip"
:
"ماه گذشته"
"previousMonthTooltip"
:
"ماه گذشته"
,
"licensesPageTitle"
:
"مجوز"
,
"cancelButtonLabel"
:
"لغو"
,
"closeButtonLabel"
:
"بستن"
,
"continueButtonLabel"
:
"ادامه دهید"
,
"copyButtonLabel"
:
"کپی"
,
"cutButtonLabel"
:
"برش"
,
"okButtonLabel"
:
"تایید"
,
"pasteButtonLabel"
:
"چسباندن"
,
"selectAllButtonLabel"
:
"انتخاب همه"
,
"viewLicensesButtonLabel"
:
"مشاهده مجوز"
}
\ No newline at end of file
packages/flutter/lib/src/material/i18n/material_fr.arb
View file @
60c4ff93
{
"openAppDrawerTooltip"
:
"Ouvrir le menu de navigation"
,
"backButtonTooltip"
:
"
Arrière
"
,
"backButtonTooltip"
:
"
Retour
"
,
"closeButtonTooltip"
:
"Fermer"
,
"nextMonthTooltip"
:
"Mois Suivant"
,
"previousMonthTooltip"
:
"Le mois précédent"
"previousMonthTooltip"
:
"Mois précédent"
,
"licensesPageTitle"
:
"Licences"
,
"cancelButtonLabel"
:
"ANNULER"
,
"closeButtonLabel"
:
"FERMER"
,
"continueButtonLabel"
:
"CONTINUER"
,
"copyButtonLabel"
:
"COPIER"
,
"cutButtonLabel"
:
"COUPER"
,
"okButtonLabel"
:
"OK"
,
"pasteButtonLabel"
:
"COLLER"
,
"selectAllButtonLabel"
:
"TOUT SÉLECTIONNER"
,
"viewLicensesButtonLabel"
:
"AFFICHER LES LICENCES"
}
packages/flutter/lib/src/material/i18n/material_he.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"אחורה"
,
"closeButtonTooltip"
:
"סגור"
,
"nextMonthTooltip"
:
"חודש הבא"
,
"previousMonthTooltip"
:
"חודש שעבר"
"previousMonthTooltip"
:
"חודש שעבר"
,
"licensesPageTitle"
:
"רישיונות"
,
"cancelButtonLabel"
:
"ביטול"
,
"closeButtonLabel"
:
"סגור"
,
"continueButtonLabel"
:
"לְהַמשִׁיך"
,
"copyButtonLabel"
:
"קיבלתי!"
,
"cutButtonLabel"
:
"גזור"
,
"okButtonLabel"
:
"בסדר"
,
"pasteButtonLabel"
:
"הדבק"
,
"selectAllButtonLabel"
:
"בחר הכל"
,
"viewLicensesButtonLabel"
:
"ראה רישיונות"
}
\ No newline at end of file
packages/flutter/lib/src/material/i18n/material_it.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"Indietro"
,
"closeButtonTooltip"
:
"Chiudi"
,
"nextMonthTooltip"
:
"Il prossimo mese"
,
"previousMonthTooltip"
:
"Il mese scorso"
"previousMonthTooltip"
:
"Il mese scorso"
,
"licensesPageTitle"
:
"Licenze"
,
"cancelButtonLabel"
:
"ANNULLA"
,
"closeButtonLabel"
:
"CHIUDI"
,
"continueButtonLabel"
:
"CONTINUA"
,
"copyButtonLabel"
:
"COPY"
,
"cutButtonLabel"
:
"TAGLIARE"
,
"okButtonLabel"
:
"OK"
,
"pasteButtonLabel"
:
"INCOLLA"
,
"selectAllButtonLabel"
:
"SELEZIONA TUTTO"
,
"viewLicensesButtonLabel"
:
"VEDI LE LICENZE"
}
packages/flutter/lib/src/material/i18n/material_ja.arb
View file @
60c4ff93
{
"openAppDrawerTooltip"
:
"ナビゲーションメニューを開く"
,
"backButtonTooltip"
:
"
バック
"
,
"backButtonTooltip"
:
"
戻る
"
,
"closeButtonTooltip"
:
"閉じる"
,
"nextMonthTooltip"
:
"来月"
,
"previousMonthTooltip"
:
"前の月"
"nextMonthTooltip"
:
"前の月へ"
,
"previousMonthTooltip"
:
"前の月へ"
,
"licensesPageTitle"
:
"ライセンス"
,
"cancelButtonLabel"
:
"キャンセル"
,
"closeButtonLabel"
:
"閉じる"
,
"continueButtonLabel"
:
"次へ"
,
"copyButtonLabel"
:
"コピー"
,
"cutButtonLabel"
:
"カット"
,
"okButtonLabel"
:
"OK"
,
"pasteButtonLabel"
:
"貼付け"
,
"selectAllButtonLabel"
:
"全選択"
,
"viewLicensesButtonLabel"
:
"ライセンス表記"
}
packages/flutter/lib/src/material/i18n/material_ps.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"شاته"
,
"closeButtonTooltip"
:
"بنده"
,
"nextMonthTooltip"
:
"بله میاشت"
,
"previousMonthTooltip"
:
"تیره میاشت"
"previousMonthTooltip"
:
"تیره میاشت"
,
"licensesPageTitle"
:
"جوازونه"
,
"cancelButtonLabel"
:
"لغوه کول"
,
"closeButtonLabel"
:
"تړل"
,
"continueButtonLabel"
:
"منځپانګې"
,
"copyButtonLabel"
:
"کاپی"
,
"cutButtonLabel"
:
"کم کړئ"
,
"okButtonLabel"
:
"سمه ده"
,
"pasteButtonLabel"
:
"پیټ کړئ"
,
"selectAllButtonLabel"
:
"غوره کړئ"
,
"viewLicensesButtonLabel"
:
"لیدلس وګورئ"
}
\ No newline at end of file
packages/flutter/lib/src/material/i18n/material_pt.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"Costas"
,
"closeButtonTooltip"
:
"Fechar"
,
"nextMonthTooltip"
:
"Próximo mês"
,
"previousMonthTooltip"
:
"Mês anterior"
"previousMonthTooltip"
:
"Mês anterior"
,
"licensesPageTitle"
:
"Licenças"
,
"cancelButtonLabel"
:
"CANCELAR"
,
"closeButtonLabel"
:
"FECHAR"
,
"continueButtonLabel"
:
"CONTINUAR"
,
"copyButtonLabel"
:
"CÓPIA DE"
,
"cutButtonLabel"
:
"CORTA"
,
"okButtonLabel"
:
"OK"
,
"pasteButtonLabel"
:
"COLAR"
,
"selectAllButtonLabel"
:
"SELECIONAR TUDO"
,
"viewLicensesButtonLabel"
:
"VER LICENÇAS"
}
packages/flutter/lib/src/material/i18n/material_ru.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"назад"
,
"closeButtonTooltip"
:
"Закрыть"
,
"nextMonthTooltip"
:
"В следующем месяце"
,
"previousMonthTooltip"
:
"Предыдущий месяц"
"previousMonthTooltip"
:
"Предыдущий месяц"
,
"licensesPageTitle"
:
"Лицензии"
,
"cancelButtonLabel"
:
"ОТМЕНА"
,
"closeButtonLabel"
:
"ЗАКРЫТЬ"
,
"continueButtonLabel"
:
"ПРОДОЛЖАТЬ"
,
"copyButtonLabel"
:
"копия"
,
"cutButtonLabel"
:
"порез"
,
"okButtonLabel"
:
"ОК"
,
"pasteButtonLabel"
:
"Паст"
,
"selectAllButtonLabel"
:
"Выбрать все"
,
"viewLicensesButtonLabel"
:
"ПРОСМОТРЕТЬ ЛИЦЕНЗИИ"
}
packages/flutter/lib/src/material/i18n/material_sd.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"پوئتي"
,
"closeButtonTooltip"
:
"بند ڪريو"
,
"nextMonthTooltip"
:
"ايندڙ مهيني"
,
"previousMonthTooltip"
:
"پويون مهينو"
}
\ No newline at end of file
"previousMonthTooltip"
:
"پويون مهينو"
,
"licensesPageTitle"
:
"لائسنس"
,
"cancelButtonLabel"
:
"منسوخ ڪيو"
,
"closeButtonLabel"
:
"بند ڪريو"
,
"continueButtonLabel"
:
"جاري رکو"
,
"copyButtonLabel"
:
"ڪاپي"
,
"cutButtonLabel"
:
"پٽي"
,
"okButtonLabel"
:
"ٺيڪ آهي"
,
"pasteButtonLabel"
:
"پيسٽ ڪريو"
,
"selectAllButtonLabel"
:
"سڀ چونڊيو"
,
"viewLicensesButtonLabel"
:
"لائسنس ڏسو"
}
packages/flutter/lib/src/material/i18n/material_ur.arb
View file @
60c4ff93
...
...
@@ -3,5 +3,15 @@
"backButtonTooltip"
:
"واپس"
,
"closeButtonTooltip"
:
"بند کریں"
,
"nextMonthTooltip"
:
"اگلا مھینہ"
,
"previousMonthTooltip"
:
"پچھلا مھینہ"
"previousMonthTooltip"
:
"پچھلا مھینہ"
,
"licensesPageTitle"
:
"لائسنس"
,
"cancelButtonLabel"
:
"منسوخ کریں"
,
"closeButtonLabel"
:
"بند کریں"
,
"continueButtonLabel"
:
"جاری رکھیں"
,
"copyButtonLabel"
:
"کاپی"
,
"cutButtonLabel"
:
"کاٹیں"
,
"okButtonLabel"
:
"ٹھیک ہے"
,
"pasteButtonLabel"
:
"چسپاں"
,
"selectAllButtonLabel"
:
"تکاپیمام منتخب کریں"
,
"viewLicensesButtonLabel"
:
"لائسنس دیکھیں"
}
\ No newline at end of file
packages/flutter/lib/src/material/i18n/material_zh.arb
View file @
60c4ff93
{
"openAppDrawerTooltip"
:
"打开导航菜单"
,
"backButtonTooltip"
:
"背部"
,
"closeButtonTooltip"
:
"关"
,
"nextMonthTooltip"
:
"-下月就29了。"
,
"previousMonthTooltip"
:
"前一个月"
"backButtonTooltip"
:
"返回"
,
"closeButtonTooltip"
:
"关闭"
,
"nextMonthTooltip"
:
"下一个月"
,
"previousMonthTooltip"
:
"上一个月"
,
"licensesPageTitle"
:
"许可证"
,
"cancelButtonLabel"
:
"取消"
,
"continueButtonLabel"
:
"继续"
,
"closeButtonLabel"
:
"关闭"
,
"copyButtonLabel"
:
"复制"
,
"cutButtonLabel"
:
"剪切"
,
"okButtonLabel"
:
"确定"
,
"pasteButtonLabel"
:
"粘贴"
,
"selectAllButtonLabel"
:
"全选"
,
"viewLicensesButtonLabel"
:
"查看许可证"
}
packages/flutter/lib/src/material/material_localizations.dart
View file @
60c4ff93
...
...
@@ -31,6 +31,36 @@ abstract class MaterialLocalizations {
/// The tooltip for the [MonthPicker]'s "previous month" button.
String
get
previousMonthTooltip
;
/// Title for the [LicensePage] widget.
String
get
licensesPageTitle
;
/// Label for "cancel" buttons and menu items.
String
get
cancelButtonLabel
;
/// Label for "close" buttons and menu items.
String
get
closeButtonLabel
;
/// Label for "continue" buttons and menu items.
String
get
continueButtonLabel
;
/// Label for "copy" edit buttons and menu items.
String
get
copyButtonLabel
;
/// Label for "cut" edit buttons and menu items.
String
get
cutButtonLabel
;
/// Label for OK buttons and menu items.
String
get
okButtonLabel
;
/// Label for "paste" edit buttons and menu items.
String
get
pasteButtonLabel
;
/// Label for "select all" edit buttons and menu items.
String
get
selectAllButtonLabel
;
/// Label for the [AboutBox] button that shows the [LicensePage].
String
get
viewLicensesButtonLabel
;
/// The `MaterialLocalizations` from the closest [Localizations] instance
/// that encloses the given context.
///
...
...
@@ -84,6 +114,36 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
@override
String
get
previousMonthTooltip
=>
_nameToValue
[
"previousMonthTooltip"
];
@override
String
get
licensesPageTitle
=>
_nameToValue
[
"licensesPageTitle"
];
@override
String
get
cancelButtonLabel
=>
_nameToValue
[
"cancelButtonLabel"
];
@override
String
get
closeButtonLabel
=>
_nameToValue
[
"closeButtonLabel"
];
@override
String
get
continueButtonLabel
=>
_nameToValue
[
"continueButtonLabel"
];
@override
String
get
copyButtonLabel
=>
_nameToValue
[
"copyButtonLabel"
];
@override
String
get
cutButtonLabel
=>
_nameToValue
[
"cutButtonLabel"
];
@override
String
get
okButtonLabel
=>
_nameToValue
[
"okButtonLabel"
];
@override
String
get
pasteButtonLabel
=>
_nameToValue
[
"pasteButtonLabel"
];
@override
String
get
selectAllButtonLabel
=>
_nameToValue
[
"selectAllButtonLabel"
];
@override
String
get
viewLicensesButtonLabel
=>
_nameToValue
[
"viewLicensesButtonLabel"
];
/// Creates an object that provides localized resource values for the
/// for the widgets of the material library.
///
...
...
packages/flutter/lib/src/material/stepper.dart
View file @
60c4ff93
...
...
@@ -12,6 +12,7 @@ import 'flat_button.dart';
import
'icons.dart'
;
import
'ink_well.dart'
;
import
'material.dart'
;
import
'material_localizations.dart'
;
import
'theme.dart'
;
import
'typography.dart'
;
...
...
@@ -339,6 +340,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
assert
(
cancelColor
!=
null
);
final
ThemeData
themeData
=
Theme
.
of
(
context
);
final
MaterialLocalizations
localizations
=
MaterialLocalizations
.
of
(
context
);
return
new
Container
(
margin:
const
EdgeInsets
.
only
(
top:
16.0
),
...
...
@@ -351,7 +353,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
color:
_isDark
()
?
themeData
.
backgroundColor
:
themeData
.
primaryColor
,
textColor:
Colors
.
white
,
textTheme:
ButtonTextTheme
.
normal
,
child:
const
Text
(
'CONTINUE'
),
child:
new
Text
(
localizations
.
continueButtonLabel
),
),
new
Container
(
margin:
const
EdgeInsetsDirectional
.
only
(
start:
8.0
),
...
...
@@ -359,7 +361,7 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
onPressed:
widget
.
onStepCancel
,
textColor:
cancelColor
,
textTheme:
ButtonTextTheme
.
normal
,
child:
const
Text
(
'CANCEL'
),
child:
new
Text
(
localizations
.
cancelButtonLabel
),
),
),
],
...
...
packages/flutter/lib/src/material/text_selection.dart
View file @
60c4ff93
...
...
@@ -10,6 +10,7 @@ import 'package:flutter/services.dart';
import
'flat_button.dart'
;
import
'material.dart'
;
import
'material_localizations.dart'
;
import
'theme.dart'
;
const
double
_kHandleSize
=
22.0
;
...
...
@@ -39,20 +40,21 @@ class _TextSelectionToolbar extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
final
List
<
Widget
>
items
=
<
Widget
>[];
final
MaterialLocalizations
localizations
=
MaterialLocalizations
.
of
(
context
);
if
(!
value
.
selection
.
isCollapsed
)
{
items
.
add
(
new
FlatButton
(
child:
const
Text
(
'CUT'
),
onPressed:
handleCut
));
items
.
add
(
new
FlatButton
(
child:
const
Text
(
'COPY'
),
onPressed:
handleCopy
));
items
.
add
(
new
FlatButton
(
child:
new
Text
(
localizations
.
cutButtonLabel
),
onPressed:
handleCut
));
items
.
add
(
new
FlatButton
(
child:
new
Text
(
localizations
.
copyButtonLabel
),
onPressed:
handleCopy
));
}
items
.
add
(
new
FlatButton
(
child:
const
Text
(
'PASTE'
),
child:
new
Text
(
localizations
.
pasteButtonLabel
),
// TODO(https://github.com/flutter/flutter/issues/11254):
// This should probably be grayed-out if there is nothing to paste.
onPressed:
handlePaste
,
));
if
(
value
.
text
.
isNotEmpty
)
{
if
(
value
.
selection
.
isCollapsed
)
items
.
add
(
new
FlatButton
(
child:
const
Text
(
'SELECT ALL'
),
onPressed:
handleSelectAll
));
items
.
add
(
new
FlatButton
(
child:
new
Text
(
localizations
.
selectAllButtonLabel
),
onPressed:
handleSelectAll
));
}
return
new
Material
(
...
...
packages/flutter/lib/src/material/time_picker.dart
View file @
60c4ff93
...
...
@@ -15,6 +15,7 @@ import 'colors.dart';
import
'dialog.dart'
;
import
'feedback.dart'
;
import
'flat_button.dart'
;
import
'material_localizations.dart'
;
import
'theme.dart'
;
import
'typography.dart'
;
...
...
@@ -697,15 +698,16 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
)
);
final
MaterialLocalizations
localizations
=
MaterialLocalizations
.
of
(
context
);
final
Widget
actions
=
new
ButtonTheme
.
bar
(
child:
new
ButtonBar
(
children:
<
Widget
>[
new
FlatButton
(
child:
const
Text
(
'CANCEL'
),
child:
new
Text
(
localizations
.
cancelButtonLabel
),
onPressed:
_handleCancel
),
new
FlatButton
(
child:
const
Text
(
'OK'
),
child:
new
Text
(
localizations
.
okButtonLabel
),
onPressed:
_handleOk
),
]
...
...
packages/flutter/test/material/localizations_test.dart
View file @
60c4ff93
...
...
@@ -23,9 +23,9 @@ Widget buildFrame({
}
void
main
(
)
{
final
Key
textKey
=
new
UniqueKey
();
testWidgets
(
'sanity check'
,
(
WidgetTester
tester
)
async
{
final
Key
textKey
=
new
UniqueKey
();
await
tester
.
pumpWidget
(
buildFrame
(
buildContent:
(
BuildContext
context
)
{
...
...
@@ -49,4 +49,44 @@ void main() {
await
tester
.
pump
();
expect
(
tester
.
widget
<
Text
>(
find
.
byKey
(
textKey
)).
data
,
'Back'
);
});
testWidgets
(
'translations exist for all materia/i18n languages'
,
(
WidgetTester
tester
)
async
{
final
List
<
String
>
languages
=
<
String
>[
'ar'
,
// Arabic
'de'
,
// German
'en'
,
// English
'es'
,
// Spanish
'fa'
,
// Farsi (Persian)
'fr'
,
// French
'he'
,
// Hebrew
'it'
,
// Italian
'ja'
,
// Japanese
'ps'
,
// Pashto
'pt'
,
// Portugese
'ru'
,
// Russian
'sd'
,
// Sindhi
'ur'
,
// Urdu
'zh'
,
// Chinese (simplified)
];
for
(
String
language
in
languages
)
{
final
Locale
locale
=
new
Locale
(
language
,
''
);
final
MaterialLocalizations
localizations
=
new
DefaultMaterialLocalizations
(
locale
);
expect
(
localizations
.
openAppDrawerTooltip
,
isNotNull
);
expect
(
localizations
.
backButtonTooltip
,
isNotNull
);
expect
(
localizations
.
closeButtonTooltip
,
isNotNull
);
expect
(
localizations
.
nextMonthTooltip
,
isNotNull
);
expect
(
localizations
.
previousMonthTooltip
,
isNotNull
);
expect
(
localizations
.
licensesPageTitle
,
isNotNull
);
expect
(
localizations
.
cancelButtonLabel
,
isNotNull
);
expect
(
localizations
.
closeButtonLabel
,
isNotNull
);
expect
(
localizations
.
continueButtonLabel
,
isNotNull
);
expect
(
localizations
.
copyButtonLabel
,
isNotNull
);
expect
(
localizations
.
cutButtonLabel
,
isNotNull
);
expect
(
localizations
.
okButtonLabel
,
isNotNull
);
expect
(
localizations
.
pasteButtonLabel
,
isNotNull
);
expect
(
localizations
.
selectAllButtonLabel
,
isNotNull
);
expect
(
localizations
.
viewLicensesButtonLabel
,
isNotNull
);
}
});
}
packages/flutter/test/material/text_field_test.dart
View file @
60c4ff93
...
...
@@ -27,34 +27,64 @@ class MockClipboard {
}
}
class
MaterialLocalizationsDelegate
extends
LocalizationsDelegate
<
MaterialLocalizations
>
{
@override
Future
<
MaterialLocalizations
>
load
(
Locale
locale
)
=>
DefaultMaterialLocalizations
.
load
(
locale
);
@override
bool
shouldReload
(
MaterialLocalizationsDelegate
old
)
=>
false
;
}
class
WidgetsLocalizationsDelegate
extends
LocalizationsDelegate
<
WidgetsLocalizations
>
{
@override
Future
<
WidgetsLocalizations
>
load
(
Locale
locale
)
=>
DefaultWidgetsLocalizations
.
load
(
locale
);
@override
bool
shouldReload
(
WidgetsLocalizationsDelegate
old
)
=>
false
;
}
Widget
overlay
(
{
Widget
child
})
{
return
new
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
new
MediaQuery
(
data:
const
MediaQueryData
(
size:
const
Size
(
800.0
,
600.0
)),
child:
new
Overlay
(
initialEntries:
<
OverlayEntry
>[
new
OverlayEntry
(
builder:
(
BuildContext
context
)
=>
new
Center
(
child:
new
Material
(
child:
child
,
return
new
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
<
LocalizationsDelegate
<
dynamic
>>[
new
WidgetsLocalizationsDelegate
(),
new
MaterialLocalizationsDelegate
(),
],
child:
new
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
new
MediaQuery
(
data:
const
MediaQueryData
(
size:
const
Size
(
800.0
,
600.0
)),
child:
new
Overlay
(
initialEntries:
<
OverlayEntry
>[
new
OverlayEntry
(
builder:
(
BuildContext
context
)
=>
new
Center
(
child:
new
Material
(
child:
child
,
),
),
),
)
,
]
,
]
,
)
,
),
),
);
}
Widget
boilerplate
(
{
Widget
child
})
{
return
new
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
new
MediaQuery
(
data:
const
MediaQueryData
(
size:
const
Size
(
800.0
,
600.0
)),
child:
new
Center
(
child:
new
Material
(
child:
child
,
return
new
Localizations
(
locale:
const
Locale
(
'en'
,
'US'
),
delegates:
<
LocalizationsDelegate
<
dynamic
>>[
new
WidgetsLocalizationsDelegate
(),
new
MaterialLocalizationsDelegate
(),
],
child:
new
Directionality
(
textDirection:
TextDirection
.
ltr
,
child:
new
MediaQuery
(
data:
const
MediaQueryData
(
size:
const
Size
(
800.0
,
600.0
)),
child:
new
Center
(
child:
new
Material
(
child:
child
,
),
),
),
),
...
...
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