diff --git a/packages/flutter_localizations/lib/src/material_localizations.dart b/packages/flutter_localizations/lib/src/material_localizations.dart index 40f056740d..805d653e84 100644 --- a/packages/flutter_localizations/lib/src/material_localizations.dart +++ b/packages/flutter_localizations/lib/src/material_localizations.dart @@ -284,7 +284,7 @@ class GlobalMaterialLocalizations implements MaterialLocalizations { final String template = _translationBundle.tabLabel; return template .replaceFirst(r'$tabIndex', formatDecimal(tabIndex)) - .replaceFirst(r'tabCount', formatDecimal(tabCount)); + .replaceFirst(r'$tabCount', formatDecimal(tabCount)); } @override diff --git a/packages/flutter_localizations/test/translations_test.dart b/packages/flutter_localizations/test/translations_test.dart index d058732a93..7fa05e7f5d 100644 --- a/packages/flutter_localizations/test/translations_test.dart +++ b/packages/flutter_localizations/test/translations_test.dart @@ -82,8 +82,8 @@ void main() { expect(localizations.pageRowsInfoTitle(1, 10, 100, false), isNot(contains(r'$rowCount'))); expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNotNull); - expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNot(contains('tabIndex'))); - expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNot(contains('tabCount'))); + expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNot(contains(r'$tabIndex'))); + expect(localizations.tabLabel(tabIndex: 2, tabCount: 5), isNot(contains(r'$tabCount'))); expect(() => localizations.tabLabel(tabIndex: 0, tabCount: 5), throwsAssertionError); expect(() => localizations.tabLabel(tabIndex: 2, tabCount: 0), throwsAssertionError); });