Commit 08869497 authored by Hans Muller's avatar Hans Muller Committed by GitHub

About Box L10N (#12062)

parent 9fb6fd81
......@@ -109,7 +109,8 @@ class AboutListTile extends StatelessWidget {
assert(debugCheckHasMaterial(context));
return new ListTile(
leading: icon,
title: child ?? new Text('About ${applicationName ?? _defaultApplicationName(context)}'),
title: child ??
new Text(MaterialLocalizations.of(context).aboutListTileTitle(applicationName ?? _defaultApplicationName(context))),
onTap: () {
showAboutDialog(
context: context,
......@@ -421,6 +422,7 @@ class _LicensePageState extends State<LicensePage> {
Widget build(BuildContext context) {
final String name = widget.applicationName ?? _defaultApplicationName(context);
final String version = widget.applicationVersion ?? _defaultApplicationVersion(context);
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
final List<Widget> contents = <Widget>[
new Text(name, style: Theme.of(context).textTheme.headline, textAlign: TextAlign.center),
new Text(version, style: Theme.of(context).textTheme.body1, textAlign: TextAlign.center),
......@@ -441,15 +443,21 @@ class _LicensePageState extends State<LicensePage> {
}
return new Scaffold(
appBar: new AppBar(
title: new Text(MaterialLocalizations.of(context).licensesPageTitle),
title: new Text(localizations.licensesPageTitle),
),
body: new DefaultTextStyle(
style: Theme.of(context).textTheme.caption,
child: new Scrollbar(
child: new ListView(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
shrinkWrap: true,
children: contents,
// All of the licenses page text is English. We don't want localized text
// or text direction.
body: new Localizations.override(
locale: const Locale('en', 'US'),
context: context,
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.caption,
child: new Scrollbar(
child: new ListView(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
shrinkWrap: true,
children: contents,
),
),
),
),
......
......@@ -21,6 +21,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"الصفحة التالية",
"previousPageTooltip": r"الصفحة السابقة",
"showMenuTooltip": r"قائمة العرض",
"aboutListTileTitle": r"حول $applicationName",
"licensesPageTitle": r"التّراخيص",
"pageRowsInfoTitle": r"$firstRow–$lastRow أو $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow من حوالي $rowCount",
......@@ -48,6 +49,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"Nächste Seite",
"previousPageTooltip": r"Vorherige Seite",
"showMenuTooltip": r"Menü anzeigen",
"aboutListTileTitle": r"Über $applicationName",
"licensesPageTitle": r"Lizenzen",
"pageRowsInfoTitle": r"$firstRow–$lastRow von $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow von etwa $rowCount",
......@@ -75,6 +77,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"Next page",
"previousPageTooltip": r"Previous page",
"showMenuTooltip": r"Show menu",
"aboutListTileTitle": r"About $applicationName",
"licensesPageTitle": r"Licenses",
"pageRowsInfoTitle": r"$firstRow–$lastRow of $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow of about $rowCount",
......@@ -113,6 +116,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"Siguiente página",
"previousPageTooltip": r"Pagina anterior",
"showMenuTooltip": r"Muestrame el menu",
"aboutListTileTitle": r"Desarrollado por $applicationName",
"licensesPageTitle": r"Licencias",
"pageRowsInfoTitle": r"$firstRow–$lastRow de $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow de aproximadamente $rowCount",
......@@ -143,6 +147,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"صفحه بعد",
"previousPageTooltip": r"صفحه قبلی",
"showMenuTooltip": r"نمایش منو",
"aboutListTileTitle": r"درباره $applicationName",
"licensesPageTitle": r"مجوز",
"pageRowsInfoTitle": r"$firstRow–$lastRow از $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow از حدود $rowCount",
......@@ -168,6 +173,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"Page suivante",
"previousPageTooltip": r"Page précédente",
"showMenuTooltip": r"Afficher le menu",
"aboutListTileTitle": r"À propos de $applicationName",
"licensesPageTitle": r"Licences",
"pageRowsInfoTitle": r"$firstRow–$lastRow de $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow d'environ $rowCount",
......@@ -198,6 +204,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"עמוד הבא",
"previousPageTooltip": r"עמוד קודם",
"showMenuTooltip": r"הצג תפריט",
"aboutListTileTitle": r"על $applicationName",
"licensesPageTitle": r"רישיונות",
"pageRowsInfoTitle": r"$firstRow–$lastRow מתוך $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow מתוך כ $rowCount",
......@@ -223,6 +230,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"Pagina successiva",
"previousPageTooltip": r"Pagina precedente",
"showMenuTooltip": r"Mostra il menu",
"aboutListTileTitle": r"A proposito di $applicationName",
"licensesPageTitle": r"Licenze",
"pageRowsInfoTitle": r"$firstRow–$lastRow di $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow di circa $rowCount",
......@@ -248,6 +256,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"次のページ",
"previousPageTooltip": r"前のページ",
"showMenuTooltip": r"メニューを表示",
"aboutListTileTitle": r"$applicationNameについて",
"licensesPageTitle": r"ライセンス",
"pageRowsInfoTitle": r"$rowCount行中の$firstRow–$lastRow",
"pageRowsInfoTitleApproximate": r"約$rowCount行中の$firstRow–$lastRow",
......@@ -273,6 +282,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"بله پاڼه",
"previousPageTooltip": r"مخکینی مخ",
"showMenuTooltip": r"غورنۍ ښودل",
"aboutListTileTitle": r"د $applicationName په اړه",
"licensesPageTitle": r"جوازونه",
"pageRowsInfoTitle": r"$firstRow–$lastRow د $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow څخه $rowCount د",
......@@ -298,6 +308,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"Próxima página",
"previousPageTooltip": r"Página anterior",
"showMenuTooltip": r"Mostrar menu",
"aboutListTileTitle": r"Sobre $applicationName",
"licensesPageTitle": r"Licenças",
"pageRowsInfoTitle": r"$firstRow–$lastRow de $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow de cerca de $rowCount",
......@@ -326,6 +337,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"pageRowsInfoTitle": r"$firstRow–$lastRow из $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow около $rowCount",
"rowsPerPageTitle": r"Строки на страницу:",
"aboutListTileTitle": r"O $applicationName",
"licensesPageTitle": r"Лицензии",
"selectedRowCountTitleOther": r"$selectedRowCount выбранные предметы",
"cancelButtonLabel": r"ОТМЕНА",
......@@ -348,6 +360,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"اڳيون پيج",
"previousPageTooltip": r"پويون صفحو",
"showMenuTooltip": r"ڏيکاريو",
"aboutListTileTitle": r"$applicationName بابت",
"licensesPageTitle": r"لائسنس",
"pageRowsInfoTitle": r"$firstRow–$lastRow جي $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow کان $rowCount تقريبن",
......@@ -373,6 +386,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"اگلا صفحہ",
"previousPageTooltip": r"سابقہ ​​صفحہ",
"showMenuTooltip": r"مینو دکھائیں",
"aboutListTileTitle": r"کے بارے میں $applicationName",
"licensesPageTitle": r"لائسنس",
"pageRowsInfoTitle": r"$firstRow–$lastRow کے $rowCount",
"pageRowsInfoTitleApproximate": r"$firstRow–$lastRow میں سے $rowCount تقریبا",
......@@ -400,6 +414,7 @@ const Map<String, Map<String, String>> localizations = const <String, Map<String
"nextPageTooltip": r"下一页",
"previousPageTooltip": r"上一页",
"showMenuTooltip": r"显示菜单",
"aboutListTileTitle": r"关于$applicationName",
"licensesPageTitle": r"许可证",
"pageRowsInfoTitle": r"$rowCount中的$firstRow-$lastRow",
"pageRowsInfoTitleApproximate": r"约$rowCount中的$firstRow-$lastRow",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "الصفحة التالية",
"previousPageTooltip": "الصفحة السابقة",
"showMenuTooltip": "قائمة العرض",
"aboutListTileTitle": "حول $applicationName",
"licensesPageTitle": "التّراخيص",
"pageRowsInfoTitle": "$firstRow–$lastRow أو $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow من حوالي $rowCount",
......
......@@ -8,11 +8,11 @@
"nextPageTooltip": "Nächste Seite",
"previousPageTooltip": "Vorherige Seite",
"showMenuTooltip": "Menü anzeigen",
"aboutListTileTitle": "Über $applicationName",
"licensesPageTitle": "Lizenzen",
"pageRowsInfoTitle": "$firstRow–$lastRow von $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow von etwa $rowCount",
"rowsPerPageTitle": "Zeilen pro Seite:",
"selectedRowCountTitleZero": "Keine Objekte ausgewählt",
"selectedRowCountTitleOne": "1 Objekt ausgewählt",
"selectedRowCountTitleOther": "$selectedRowCount Objekte ausgewählt",
......
......@@ -53,6 +53,12 @@
"type": "text"
},
"aboutListTileTitle": "About $applicationName",
"@aboutListTileTitle": {
"description": "The default title for AboutListTile",
"type": "text"
},
"licensesPageTitle": "Licenses",
"@licensesPageTitle": {
"description": "The title for the Flutter licenses page.",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "Siguiente página",
"previousPageTooltip": "Pagina anterior",
"showMenuTooltip": "Muestrame el menu",
"aboutListTileTitle": "Desarrollado por $applicationName",
"licensesPageTitle": "Licencias",
"pageRowsInfoTitle": "$firstRow–$lastRow de $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow de aproximadamente $rowCount",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "صفحه بعد",
"previousPageTooltip": "صفحه قبلی",
"showMenuTooltip": "نمایش منو",
"aboutListTileTitle": "درباره $applicationName",
"licensesPageTitle": "مجوز",
"pageRowsInfoTitle": "$firstRow–$lastRow از $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow از حدود $rowCount",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "Page suivante",
"previousPageTooltip": "Page précédente",
"showMenuTooltip": "Afficher le menu",
"aboutListTileTitle": "À propos de $applicationName",
"licensesPageTitle": "Licences",
"pageRowsInfoTitle": "$firstRow–$lastRow de $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow d'environ $rowCount",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "עמוד הבא",
"previousPageTooltip": "עמוד קודם",
"showMenuTooltip": "הצג תפריט",
"aboutListTileTitle": "על $applicationName",
"licensesPageTitle": "רישיונות",
"pageRowsInfoTitle": "$firstRow–$lastRow מתוך $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow מתוך כ $rowCount",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "Pagina successiva",
"previousPageTooltip": "Pagina precedente",
"showMenuTooltip": "Mostra il menu",
"aboutListTileTitle": "A proposito di $applicationName",
"licensesPageTitle": "Licenze",
"pageRowsInfoTitle": "$firstRow–$lastRow di $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow di circa $rowCount",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "次のページ",
"previousPageTooltip": "前のページ",
"showMenuTooltip": "メニューを表示",
"aboutListTileTitle": "$applicationNameについて",
"licensesPageTitle": "ライセンス",
"pageRowsInfoTitle": "$rowCount行中の$firstRow–$lastRow",
"pageRowsInfoTitleApproximate": "約$rowCount行中の$firstRow–$lastRow",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "بله پاڼه",
"previousPageTooltip": "مخکینی مخ",
"showMenuTooltip": "غورنۍ ښودل",
"aboutListTileTitle": "د $applicationName په اړه",
"licensesPageTitle": "جوازونه",
"pageRowsInfoTitle": "$firstRow–$lastRow د $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow څخه $rowCount د",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "Próxima página",
"previousPageTooltip": "Página anterior",
"showMenuTooltip": "Mostrar menu",
"aboutListTileTitle": "Sobre $applicationName",
"licensesPageTitle": "Licenças",
"pageRowsInfoTitle": "$firstRow–$lastRow de $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow de cerca de $rowCount",
......
......@@ -11,6 +11,7 @@
"pageRowsInfoTitle": "$firstRow–$lastRow из $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow около $rowCount",
"rowsPerPageTitle": "Строки на страницу:",
"aboutListTileTitle": "O $applicationName",
"licensesPageTitle": "Лицензии",
"selectedRowCountTitleOther": "$selectedRowCount выбранные предметы",
"cancelButtonLabel": "ОТМЕНА",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "اڳيون پيج",
"previousPageTooltip": "پويون صفحو",
"showMenuTooltip": "ڏيکاريو",
"aboutListTileTitle": "$applicationName بابت",
"licensesPageTitle": "لائسنس",
"pageRowsInfoTitle": "$firstRow–$lastRow جي $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow کان $rowCount تقريبن",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "اگلا صفحہ",
"previousPageTooltip": "سابقہ ​​صفحہ",
"showMenuTooltip": "مینو دکھائیں",
"aboutListTileTitle": "کے بارے میں $applicationName",
"licensesPageTitle": "لائسنس",
"pageRowsInfoTitle": "$firstRow–$lastRow کے $rowCount",
"pageRowsInfoTitleApproximate": "$firstRow–$lastRow میں سے $rowCount تقریبا",
......
......@@ -8,6 +8,7 @@
"nextPageTooltip": "下一页",
"previousPageTooltip": "上一页",
"showMenuTooltip": "显示菜单",
"aboutListTileTitle": "关于$applicationName",
"licensesPageTitle": "许可证",
"pageRowsInfoTitle": "$rowCount中的$firstRow-$lastRow",
"pageRowsInfoTitleApproximate": "约$rowCount中的$firstRow-$lastRow",
......
......@@ -41,6 +41,9 @@ abstract class MaterialLocalizations {
/// The default [PopupMenuButton] tooltip.
String get showMenuTooltip;
/// The default title for [AboutListTile].
String aboutListTileTitle(String applicationName);
/// Title for the [LicensePage] widget.
String get licensesPageTitle;
......@@ -186,6 +189,12 @@ class DefaultMaterialLocalizations implements MaterialLocalizations {
@override
String get showMenuTooltip => _nameToValue['showMenuTooltip'];
@override
String aboutListTileTitle(String applicationName) {
final String text = _nameToValue['aboutListTileTitle'];
return text.replaceFirst(r'$applicationName', applicationName);
}
@override
String get licensesPageTitle => _nameToValue['licensesPageTitle'];
......
......@@ -67,9 +67,9 @@ void main() {
testWidgets('About box logic defaults to executable name for app name', (WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: const Material(child: const AboutListTile()),
new MaterialApp(
title: 'flutter_tester',
home: const Material(child: const AboutListTile()),
),
);
expect(find.text('About flutter_tester'), findsOneWidget);
......
......@@ -123,6 +123,9 @@ void main() {
expect(localizations.selectAllButtonLabel, isNotNull);
expect(localizations.viewLicensesButtonLabel, isNotNull);
expect(localizations.aboutListTileTitle("FOO"), isNotNull);
expect(localizations.aboutListTileTitle("FOO"), contains("FOO"));
expect(localizations.selectedRowCountTitle(0), isNotNull);
expect(localizations.selectedRowCountTitle(1), isNotNull);
expect(localizations.selectedRowCountTitle(2), isNotNull);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment