Commit e295b49
authored
[generator] Fix localization error. (#702)
In d664e90 we made `generator` localizable. One of the changes was
this pattern:
- Report.Warning (0, Report.WarningReturnValue + 0, "Unknown return type {0} {1}.", java_type, context.ContextString);
+ Report.LogCodedWarning (0, Report.WarningUnknownReturnType, java_type, context.ContextString);
in which `Report.WarningUnknownReturnType` is:
"Unknown return type '{0}' for member '{1}'."
However `context.ContextString` generates a hard to localize string, e.g.
in method CreateFromXml in managed type Android.Content.Res.ColorStateList
resulting in messages such as:
warning BG8800: Unknown return type 'System.Xml.XmlReader' for member 'in method CreateFromXml in managed type Android.Content.Res.ColorStateList'.
This message doesn't "look right", nor is it itself localizable.
Instead, add a `context.GetContextTypeMember ()` method which formats the
member as a type signature, which doesn't need to be separately
localized and "reads correctly" in context:
warning BG8800: Unknown return type 'System.Xml.XmlReader' for member 'Android.Content.Res.ColorStateList.CreateFromXml(Android.Content.Res.Resources, System.Xml.XmlReader)'.1 parent 5a0e37e commit e295b49
File tree
5 files changed
+20
-6
lines changed- tools/generator
- Java.Interop.Tools.Generator.ObjectModel
5 files changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 | | |
20 | 32 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
227 | 229 | | |
228 | 230 | | |
229 | 231 | | |
| |||
260 | 262 | | |
261 | 263 | | |
262 | 264 | | |
263 | | - | |
| 265 | + | |
264 | 266 | | |
265 | 267 | | |
266 | 268 | | |
267 | | - | |
| 269 | + | |
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
0 commit comments