diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 6f7fcd68e8..89b2b63c13 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -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: [ 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 { } 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, diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index 2a8a7ec7e2..dc8610b236 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -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: [ 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, ), ], diff --git a/packages/flutter/lib/src/material/i18n/localizations.dart b/packages/flutter/lib/src/material/i18n/localizations.dart index 8764d17252..454d9e2ff7 100644 --- a/packages/flutter/lib/src/material/i18n/localizations.dart +++ b/packages/flutter/lib/src/material/i18n/localizations.dart @@ -16,104 +16,254 @@ const Map> localizations = const { "openAppDrawerTooltip": r"منوی ناوبری را باز کنید", "backButtonTooltip": r"بازگشت", "closeButtonTooltip": r"بستن", "nextMonthTooltip": r"ماه بعد", - "previousMonthTooltip": r"ماه گذشته" + "previousMonthTooltip": r"ماه گذشته", + "licensesPageTitle": r"مجوز", + "cancelButtonLabel": r"لغو", + "closeButtonLabel": r"بستن", + "continueButtonLabel": r"ادامه دهید", + "copyButtonLabel": r"کپی", + "cutButtonLabel": r"برش", + "okButtonLabel": r"تایید", + "pasteButtonLabel": r"چسباندن", + "selectAllButtonLabel": r"انتخاب همه", + "viewLicensesButtonLabel": r"مشاهده مجوز" }, "ur": const { "openAppDrawerTooltip": r"کھولیں نیویگیشن مینو", "backButtonTooltip": r"واپس", "closeButtonTooltip": r"بند کریں", "nextMonthTooltip": r"اگلا مھینہ", - "previousMonthTooltip": r"پچھلا مھینہ" + "previousMonthTooltip": r"پچھلا مھینہ", + "licensesPageTitle": r"لائسنس", + "cancelButtonLabel": r"منسوخ کریں", + "closeButtonLabel": r"بند کریں", + "continueButtonLabel": r"جاری رکھیں", + "copyButtonLabel": r"کاپی", + "cutButtonLabel": r"کاٹیں", + "okButtonLabel": r"ٹھیک ہے", + "pasteButtonLabel": r"چسپاں", + "selectAllButtonLabel": r"تکاپیمام منتخب کریں", + "viewLicensesButtonLabel": r"لائسنس دیکھیں" }, "ps": const { "openAppDrawerTooltip": r"د پرانیستی نیینګ مینو", "backButtonTooltip": r"شاته", "closeButtonTooltip": r"بنده", "nextMonthTooltip": r"بله میاشت", - "previousMonthTooltip": r"تیره میاشت" + "previousMonthTooltip": r"تیره میاشت", + "licensesPageTitle": r"جوازونه", + "cancelButtonLabel": r"لغوه کول", + "closeButtonLabel": r"تړل", + "continueButtonLabel": r"منځپانګې", + "copyButtonLabel": r"کاپی", + "cutButtonLabel": r"کم کړئ", + "okButtonLabel": r"سمه ده", + "pasteButtonLabel": r"پیټ کړئ", + "selectAllButtonLabel": r"غوره کړئ", + "viewLicensesButtonLabel": r"لیدلس وګورئ" }, "he": const { "openAppDrawerTooltip": r"פתח תפריט ניווט", "backButtonTooltip": r"אחורה", "closeButtonTooltip": r"סגור", "nextMonthTooltip": r"חודש הבא", - "previousMonthTooltip": r"חודש שעבר" + "previousMonthTooltip": r"חודש שעבר", + "licensesPageTitle": r"רישיונות", + "cancelButtonLabel": r"ביטול", + "closeButtonLabel": r"סגור", + "continueButtonLabel": r"לְהַמשִׁיך", + "copyButtonLabel": r"קיבלתי!", + "cutButtonLabel": r"גזור", + "okButtonLabel": r"בסדר", + "pasteButtonLabel": r"הדבק", + "selectAllButtonLabel": r"בחר הכל", + "viewLicensesButtonLabel": r"ראה רישיונות" }, "ar": const { "openAppDrawerTooltip": r"افتح قائمة التنقل", "backButtonTooltip": r"الى الخلف", "closeButtonTooltip": r"إغلا", "nextMonthTooltip": r"الشهر القادم", - "previousMonthTooltip": r"الشهر الماضى" + "previousMonthTooltip": r"الشهر الماضى", + "licensesPageTitle": r"التّراخيص", + "cancelButtonLabel": r"إلغاء", + "closeButtonLabel": r"أغلاق", + "continueButtonLabel": r"استمر", + "copyButtonLabel": r"نسخ", + "cutButtonLabel": r"كِم جارح", + "okButtonLabel": r"حسنا", + "pasteButtonLabel": r"عجين", + "selectAllButtonLabel": r"اختر الكل", + "viewLicensesButtonLabel": r"عرض التراخيص" }, "it": const { "openAppDrawerTooltip": r"Apri il menu di navigazione", "backButtonTooltip": r"Indietro", "closeButtonTooltip": r"Chiudi", "nextMonthTooltip": r"Il prossimo mese", - "previousMonthTooltip": r"Il mese scorso" + "previousMonthTooltip": r"Il mese scorso", + "licensesPageTitle": r"Licenze", + "cancelButtonLabel": r"ANNULLA", + "closeButtonLabel": r"CHIUDI", + "continueButtonLabel": r"CONTINUA", + "copyButtonLabel": r"COPY", + "cutButtonLabel": r"TAGLIARE", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"INCOLLA", + "selectAllButtonLabel": r"SELEZIONA TUTTO", + "viewLicensesButtonLabel": r"VEDI LE LICENZE" }, "pt": const { "openAppDrawerTooltip": r"Abrir menu de navegação", "backButtonTooltip": r"Costas", "closeButtonTooltip": r"Fechar", "nextMonthTooltip": r"Próximo mês", - "previousMonthTooltip": r"Mês anterior" + "previousMonthTooltip": r"Mês anterior", + "licensesPageTitle": r"Licenças", + "cancelButtonLabel": r"CANCELAR", + "closeButtonLabel": r"FECHAR", + "continueButtonLabel": r"CONTINUAR", + "copyButtonLabel": r"CÓPIA DE", + "cutButtonLabel": r"CORTA", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"COLAR", + "selectAllButtonLabel": r"SELECIONAR TUDO", + "viewLicensesButtonLabel": r"VER LICENÇAS" }, "es": const { "openAppDrawerTooltip": r"Abrir el menú de navegación", "backButtonTooltip": r"Espalda", "closeButtonTooltip": r"Cerrar", "nextMonthTooltip": r"Próximo mes", - "previousMonthTooltip": r"mes anterior" + "previousMonthTooltip": r"Mes anterior", + "licensesPageTitle": r"Licencias", + "cancelButtonLabel": r"CANCELAR", + "closeButtonLabel": r"CERRAR", + "continueButtonLabel": r"CONTINUAR", + "copyButtonLabel": r"COPIAR", + "cutButtonLabel": r"CORTAR", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"PEGAR", + "selectAllButtonLabel": r"SELECCIONAR TODO", + "viewLicensesButtonLabel": r"VER LICENCIAS" }, "fr": const { "openAppDrawerTooltip": r"Ouvrir le menu de navigation", - "backButtonTooltip": r"Arrière", + "backButtonTooltip": r"Retour", "closeButtonTooltip": r"Fermer", "nextMonthTooltip": r"Mois Suivant", - "previousMonthTooltip": r"Le mois précédent" + "previousMonthTooltip": r"Mois précédent", + "licensesPageTitle": r"Licences", + "cancelButtonLabel": r"ANNULER", + "closeButtonLabel": r"FERMER", + "continueButtonLabel": r"CONTINUER", + "copyButtonLabel": r"COPIER", + "cutButtonLabel": r"COUPER", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"COLLER", + "selectAllButtonLabel": r"TOUT SÉLECTIONNER", + "viewLicensesButtonLabel": r"AFFICHER LES LICENCES" }, "zh": const { "openAppDrawerTooltip": r"打开导航菜单", - "backButtonTooltip": r"背部", - "closeButtonTooltip": r"关", - "nextMonthTooltip": r"-下月就29了。", - "previousMonthTooltip": r"前一个月" + "backButtonTooltip": r"返回", + "closeButtonTooltip": r"关闭", + "nextMonthTooltip": r"下一个月", + "previousMonthTooltip": r"上一个月", + "licensesPageTitle": r"许可证", + "cancelButtonLabel": r"取消", + "continueButtonLabel": r"继续", + "closeButtonLabel": r"关闭", + "copyButtonLabel": r"复制", + "cutButtonLabel": r"剪切", + "okButtonLabel": r"确定", + "pasteButtonLabel": r"粘贴", + "selectAllButtonLabel": r"全选", + "viewLicensesButtonLabel": r"查看许可证" }, "en": const { "openAppDrawerTooltip": r"Open navigation menu", "backButtonTooltip": r"Back", "closeButtonTooltip": r"Close", "nextMonthTooltip": r"Next month", - "previousMonthTooltip": r"Previous month" + "previousMonthTooltip": r"Previous month", + "licensesPageTitle": r"Licenses", + "cancelButtonLabel": r"CANCEL", + "closeButtonLabel": r"CLOSE", + "continueButtonLabel": r"CONTINUE", + "copyButtonLabel": r"COPY", + "cutButtonLabel": r"CUT", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"PASTE", + "selectAllButtonLabel": r"SELECT ALL", + "viewLicensesButtonLabel": r"VIEW LICENSES" }, "de": const { "openAppDrawerTooltip": r"Navigationsmenü öffnen", "backButtonTooltip": r"Zurück", - "closeButtonTooltip": r"Schließen ", + "closeButtonTooltip": r"Schließen", "nextMonthTooltip": r"Nächster Monat", - "previousMonthTooltip": r"Letzter Monat" + "previousMonthTooltip": r"Vorheriger Monat", + "licensesPageTitle": r"Lizenzen", + "cancelButtonLabel": r"ABBRECHEN", + "closeButtonLabel": r"SCHLIESSEN", + "continueButtonLabel": r"FORTSETZEN", + "copyButtonLabel": r"KOPIEREN", + "cutButtonLabel": r"AUSSCHNEIDEN", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"EINFÜGEN", + "selectAllButtonLabel": r"ALLES AUSWÄHLEN", + "viewLicensesButtonLabel": r"LIZENZEN ANZEIGEN" }, "ja": const { "openAppDrawerTooltip": r"ナビゲーションメニューを開く", - "backButtonTooltip": r"バック", + "backButtonTooltip": r"戻る", "closeButtonTooltip": r"閉じる", - "nextMonthTooltip": r"来月", - "previousMonthTooltip": r"前の月" + "nextMonthTooltip": r"前の月へ", + "previousMonthTooltip": r"前の月へ", + "licensesPageTitle": r"ライセンス", + "cancelButtonLabel": r"キャンセル", + "closeButtonLabel": r"閉じる", + "continueButtonLabel": r"次へ", + "copyButtonLabel": r"コピー", + "cutButtonLabel": r"カット", + "okButtonLabel": r"OK", + "pasteButtonLabel": r"貼付け", + "selectAllButtonLabel": r"全選択", + "viewLicensesButtonLabel": r"ライセンス表記" }, "ru": const { "openAppDrawerTooltip": r"Открыть меню навигации", "backButtonTooltip": r"назад", "closeButtonTooltip": r"Закрыть", "nextMonthTooltip": r"В следующем месяце", - "previousMonthTooltip": r"Предыдущий месяц" + "previousMonthTooltip": r"Предыдущий месяц", + "licensesPageTitle": r"Лицензии", + "cancelButtonLabel": r"ОТМЕНА", + "closeButtonLabel": r"ЗАКРЫТЬ", + "continueButtonLabel": r"ПРОДОЛЖАТЬ", + "copyButtonLabel": r"копия", + "cutButtonLabel": r"порез", + "okButtonLabel": r"ОК", + "pasteButtonLabel": r"Паст", + "selectAllButtonLabel": r"Выбрать все", + "viewLicensesButtonLabel": r"ПРОСМОТРЕТЬ ЛИЦЕНЗИИ" } }; diff --git a/packages/flutter/lib/src/material/i18n/material_ar.arb b/packages/flutter/lib/src/material/i18n/material_ar.arb index 1ca99b38c6..3eb1bd89cb 100644 --- a/packages/flutter/lib/src/material/i18n/material_ar.arb +++ b/packages/flutter/lib/src/material/i18n/material_ar.arb @@ -3,5 +3,15 @@ "backButtonTooltip": "الى الخلف", "closeButtonTooltip": "إغلا", "nextMonthTooltip": "الشهر القادم", - "previousMonthTooltip": "الشهر الماضى" + "previousMonthTooltip": "الشهر الماضى", + "licensesPageTitle": "التّراخيص", + "cancelButtonLabel": "إلغاء", + "closeButtonLabel": "أغلاق", + "continueButtonLabel": "استمر", + "copyButtonLabel": "نسخ", + "cutButtonLabel": "كِم جارح", + "okButtonLabel": "حسنا", + "pasteButtonLabel": "عجين", + "selectAllButtonLabel": "اختر الكل", + "viewLicensesButtonLabel": "عرض التراخيص" } diff --git a/packages/flutter/lib/src/material/i18n/material_de.arb b/packages/flutter/lib/src/material/i18n/material_de.arb index 893f065695..0786a2ed98 100644 --- a/packages/flutter/lib/src/material/i18n/material_de.arb +++ b/packages/flutter/lib/src/material/i18n/material_de.arb @@ -1,7 +1,17 @@ { "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" } diff --git a/packages/flutter/lib/src/material/i18n/material_en.arb b/packages/flutter/lib/src/material/i18n/material_en.arb index 784ad6a609..4d2b59c2f5 100644 --- a/packages/flutter/lib/src/material/i18n/material_en.arb +++ b/packages/flutter/lib/src/material/i18n/material_en.arb @@ -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" } } diff --git a/packages/flutter/lib/src/material/i18n/material_es.arb b/packages/flutter/lib/src/material/i18n/material_es.arb index 2e793f9c5e..1f82f9a6b6 100644 --- a/packages/flutter/lib/src/material/i18n/material_es.arb +++ b/packages/flutter/lib/src/material/i18n/material_es.arb @@ -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" } diff --git a/packages/flutter/lib/src/material/i18n/material_fa.arb b/packages/flutter/lib/src/material/i18n/material_fa.arb index cdb1c03953..375536874a 100644 --- a/packages/flutter/lib/src/material/i18n/material_fa.arb +++ b/packages/flutter/lib/src/material/i18n/material_fa.arb @@ -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 diff --git a/packages/flutter/lib/src/material/i18n/material_fr.arb b/packages/flutter/lib/src/material/i18n/material_fr.arb index 8df70b221a..0482f39e63 100644 --- a/packages/flutter/lib/src/material/i18n/material_fr.arb +++ b/packages/flutter/lib/src/material/i18n/material_fr.arb @@ -1,7 +1,17 @@ { "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" } diff --git a/packages/flutter/lib/src/material/i18n/material_he.arb b/packages/flutter/lib/src/material/i18n/material_he.arb index 5e4c45f4a6..4b7f9884f2 100644 --- a/packages/flutter/lib/src/material/i18n/material_he.arb +++ b/packages/flutter/lib/src/material/i18n/material_he.arb @@ -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 diff --git a/packages/flutter/lib/src/material/i18n/material_it.arb b/packages/flutter/lib/src/material/i18n/material_it.arb index 8995817ff5..a3b342924c 100644 --- a/packages/flutter/lib/src/material/i18n/material_it.arb +++ b/packages/flutter/lib/src/material/i18n/material_it.arb @@ -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" } diff --git a/packages/flutter/lib/src/material/i18n/material_ja.arb b/packages/flutter/lib/src/material/i18n/material_ja.arb index 2c2c671fc3..f00368c997 100644 --- a/packages/flutter/lib/src/material/i18n/material_ja.arb +++ b/packages/flutter/lib/src/material/i18n/material_ja.arb @@ -1,7 +1,17 @@ { "openAppDrawerTooltip": "ナビゲーションメニューを開く", - "backButtonTooltip": "バック", + "backButtonTooltip": "戻る", "closeButtonTooltip": "閉じる", - "nextMonthTooltip": "来月", - "previousMonthTooltip": "前の月" + "nextMonthTooltip": "前の月へ", + "previousMonthTooltip": "前の月へ", + "licensesPageTitle": "ライセンス", + "cancelButtonLabel": "キャンセル", + "closeButtonLabel": "閉じる", + "continueButtonLabel": "次へ", + "copyButtonLabel": "コピー", + "cutButtonLabel": "カット", + "okButtonLabel": "OK", + "pasteButtonLabel": "貼付け", + "selectAllButtonLabel": "全選択", + "viewLicensesButtonLabel": "ライセンス表記" } diff --git a/packages/flutter/lib/src/material/i18n/material_ps.arb b/packages/flutter/lib/src/material/i18n/material_ps.arb index 80dad30224..02020740f9 100644 --- a/packages/flutter/lib/src/material/i18n/material_ps.arb +++ b/packages/flutter/lib/src/material/i18n/material_ps.arb @@ -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 diff --git a/packages/flutter/lib/src/material/i18n/material_pt.arb b/packages/flutter/lib/src/material/i18n/material_pt.arb index 404a8fb591..cc50b282a8 100644 --- a/packages/flutter/lib/src/material/i18n/material_pt.arb +++ b/packages/flutter/lib/src/material/i18n/material_pt.arb @@ -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" } diff --git a/packages/flutter/lib/src/material/i18n/material_ru.arb b/packages/flutter/lib/src/material/i18n/material_ru.arb index 2ef9d94eb4..14da322c3d 100644 --- a/packages/flutter/lib/src/material/i18n/material_ru.arb +++ b/packages/flutter/lib/src/material/i18n/material_ru.arb @@ -3,5 +3,15 @@ "backButtonTooltip": "назад", "closeButtonTooltip": "Закрыть", "nextMonthTooltip": "В следующем месяце", - "previousMonthTooltip": "Предыдущий месяц" + "previousMonthTooltip": "Предыдущий месяц", + "licensesPageTitle": "Лицензии", + "cancelButtonLabel": "ОТМЕНА", + "closeButtonLabel": "ЗАКРЫТЬ", + "continueButtonLabel": "ПРОДОЛЖАТЬ", + "copyButtonLabel": "копия", + "cutButtonLabel": "порез", + "okButtonLabel": "ОК", + "pasteButtonLabel": "Паст", + "selectAllButtonLabel": "Выбрать все", + "viewLicensesButtonLabel": "ПРОСМОТРЕТЬ ЛИЦЕНЗИИ" } diff --git a/packages/flutter/lib/src/material/i18n/material_sd.arb b/packages/flutter/lib/src/material/i18n/material_sd.arb index 7c9ddc8354..9904b98dae 100644 --- a/packages/flutter/lib/src/material/i18n/material_sd.arb +++ b/packages/flutter/lib/src/material/i18n/material_sd.arb @@ -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": "لائسنس ڏسو" +} diff --git a/packages/flutter/lib/src/material/i18n/material_ur.arb b/packages/flutter/lib/src/material/i18n/material_ur.arb index 11b7245dca..8b22fb120e 100644 --- a/packages/flutter/lib/src/material/i18n/material_ur.arb +++ b/packages/flutter/lib/src/material/i18n/material_ur.arb @@ -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 diff --git a/packages/flutter/lib/src/material/i18n/material_zh.arb b/packages/flutter/lib/src/material/i18n/material_zh.arb index 033c3c468e..9f698a65b4 100644 --- a/packages/flutter/lib/src/material/i18n/material_zh.arb +++ b/packages/flutter/lib/src/material/i18n/material_zh.arb @@ -1,7 +1,17 @@ { "openAppDrawerTooltip": "打开导航菜单", - "backButtonTooltip": "背部", - "closeButtonTooltip": "关", - "nextMonthTooltip": "-下月就29了。", - "previousMonthTooltip": "前一个月" + "backButtonTooltip": "返回", + "closeButtonTooltip": "关闭", + "nextMonthTooltip": "下一个月", + "previousMonthTooltip": "上一个月", + "licensesPageTitle": "许可证", + "cancelButtonLabel": "取消", + "continueButtonLabel": "继续", + "closeButtonLabel": "关闭", + "copyButtonLabel": "复制", + "cutButtonLabel": "剪切", + "okButtonLabel": "确定", + "pasteButtonLabel": "粘贴", + "selectAllButtonLabel": "全选", + "viewLicensesButtonLabel": "查看许可证" } diff --git a/packages/flutter/lib/src/material/material_localizations.dart b/packages/flutter/lib/src/material/material_localizations.dart index 4003ffb1b5..54e393a378 100644 --- a/packages/flutter/lib/src/material/material_localizations.dart +++ b/packages/flutter/lib/src/material/material_localizations.dart @@ -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. /// diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index 8a0c229660..6db7d4e1df 100644 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -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 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 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 with TickerProviderStateMixin { onPressed: widget.onStepCancel, textColor: cancelColor, textTheme: ButtonTextTheme.normal, - child: const Text('CANCEL'), + child: new Text(localizations.cancelButtonLabel), ), ), ], diff --git a/packages/flutter/lib/src/material/text_selection.dart b/packages/flutter/lib/src/material/text_selection.dart index fd5dd3636e..d191dc65b6 100644 --- a/packages/flutter/lib/src/material/text_selection.dart +++ b/packages/flutter/lib/src/material/text_selection.dart @@ -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 items = []; + 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( diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index f1ce572244..3c6c16d5f9 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -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: [ 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 ), ] diff --git a/packages/flutter/test/material/localizations_test.dart b/packages/flutter/test/material/localizations_test.dart index d6ed0d877d..358e752337 100644 --- a/packages/flutter/test/material/localizations_test.dart +++ b/packages/flutter/test/material/localizations_test.dart @@ -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(find.byKey(textKey)).data, 'Back'); }); + + testWidgets('translations exist for all materia/i18n languages', (WidgetTester tester) async { + final List languages = [ + '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); + } + }); } diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index f2ea7f9769..49396cf30e 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -27,34 +27,64 @@ class MockClipboard { } } +class MaterialLocalizationsDelegate extends LocalizationsDelegate { + @override + Future load(Locale locale) => DefaultMaterialLocalizations.load(locale); + + @override + bool shouldReload(MaterialLocalizationsDelegate old) => false; +} + +class WidgetsLocalizationsDelegate extends LocalizationsDelegate { + @override + Future 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: [ - new OverlayEntry( - builder: (BuildContext context) => new Center( - child: new Material( - child: child, + return new Localizations( + locale: const Locale('en', 'US'), + delegates: >[ + 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: [ + 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: >[ + 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, + ), ), ), ),