You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/flutter_localizations/README.md
+63-4Lines changed: 63 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,46 @@ and it has a tooltip), follow these steps (these instructions are for
15
15
`MaterialLocalizations`, but apply equally to `CupertinoLocalizations`
16
16
and `WidgetsLocalizations`, with appropriate name substitutions):
17
17
18
-
1. Add the new getter to the localizations class `MaterialLocalizations`,
19
-
in `flutter_localizations/lib/src/material_localizations.dart`.
18
+
1.### For messages without parameters, add new getter
19
+
```
20
+
String get showMenuTooltip;
21
+
```
22
+
to the localizations class `MaterialLocalizations`,
23
+
in [`packages/flutter/lib/src/material/material_localizations.dart`](https://github.com/harperl-lgtm/flutter/blob/bottomSheetScrimFocus/packages/flutter/lib/src/material/material_localizations.dart);
24
+
25
+
### For messages with parameters, add new function
For messages with parameters, do also add the function to `GlobalMaterialLocalizations` in [`packages/flutter_localizations/lib/src/material_localizations.dart`](https://github.com/harperl-lgtm/flutter/blob/bottomSheetScrimFocus/packages/flutter_localizations/lib/src/material_localizations.dart), and add a raw getter as demonstrated below:
45
+
46
+
```
47
+
/// The raw version of [aboutListTileTitle], with `$applicationName` verbatim
3. Add a test to `test/material/localizations_test.dart` that verifies that
25
60
this new value is implemented.
@@ -28,6 +63,23 @@ and `WidgetsLocalizations`, with appropriate name substitutions):
28
63
`flutter_localizations` package, you must first add it to the English
29
64
translations (`lib/src/l10n/material_en.arb`), including a description.
30
65
66
+
### Messages without parameters:
67
+
```
68
+
"showMenuTooltip": "Show menu",
69
+
"@showMenuTooltip": {
70
+
"description": "The tooltip for the button that shows a popup menu."
71
+
},
72
+
```
73
+
74
+
### Messages with parameters:
75
+
```
76
+
"aboutListTileTitle": "About $applicationName",
77
+
"@aboutListTileTitle": {
78
+
"description": "The default title for the drawer item that shows an about page for the application. The value of $applicationName is the name of the application, like GMail or Chrome.",
79
+
"parameters": "applicationName"
80
+
},
81
+
```
82
+
31
83
Then you need to add new entries for the string to all of the other
32
84
language locale files by running:
33
85
```
@@ -41,6 +93,13 @@ and `WidgetsLocalizations`, with appropriate name substitutions):
0 commit comments