Skip to content

Commit 8ea0bb2

Browse files
authored
[jnimarshalmethod-gen] Localizable errors (#696)
and warnings messages. Uses the same Java.Interop.Localization assembly as other JI tools for localizable messages. Localize error and warning messages from `jnimarshalmethod-gen.exe`. Uses the same `Java.Interop.Localization` assembly as other tools use for localizable text (d664e90). Change some of the warnings into informational output and also extend some of the warnings with more information so that the warning message is actionable.
1 parent afbc5b3 commit 8ea0bb2

19 files changed

+1021
-25
lines changed

src/Java.Interop.Localization/Resources.Designer.cs

Lines changed: 108 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Java.Interop.Localization/Resources.resx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,4 +332,54 @@ Name, com.example.MyClass.</comment>
332332
<value>Cannot override Kotlin-generated method '{0}' because it is not a valid Java method name. This method can only be overridden from Kotlin.</value>
333333
<comment>{0} - Kotlin method name.</comment>
334334
</data>
335+
<data name="JniMarshalMethodGen_JM4001" xml:space="preserve">
336+
<value>Unable to preload reference '{0}'.</value>
337+
<comment>{0} - assembly path</comment>
338+
</data>
339+
<data name="JniMarshalMethodGen_JM4002" xml:space="preserve">
340+
<value>Please specify at least one ASSEMBLY to process.</value>
341+
<comment>The following terms should not be translated or have any capitalization changes: ASSEMBLY. This is a special case for this particular message. In most messages, "assembly" would be translated.</comment>
342+
</data>
343+
<data name="JniMarshalMethodGen_JM4003" xml:space="preserve">
344+
<value>Unable to create Java VM{0}{1}</value>
345+
<comment>{0} - newline, {1} - exception</comment>
346+
</data>
347+
<data name="JniMarshalMethodGen_JM4004" xml:space="preserve">
348+
<value>Unable to read profile file '{0}'.{1}{2}</value>
349+
<comment>{0} - path, {1} - newline, {2} - exception. In this message, the term "profile" refers to a customized list of types to process.</comment>
350+
</data>
351+
<data name="JniMarshalMethodGen_JM4005" xml:space="preserve">
352+
<value>Path '{0}' does not exist.</value>
353+
<comment>{0} - path</comment>
354+
</data>
355+
<data name="JniMarshalMethodGen_JM4006" xml:space="preserve">
356+
<value>Unable to process assembly '{0}'{1}{2}{1}{3}</value>
357+
<comment>{0} - assembly, {1} - newline, {2} - exception message, {3} exception</comment>
358+
</data>
359+
<data name="JniMarshalMethodGen_JM8001" xml:space="preserve">
360+
<value>Couln't find interface {0}</value>
361+
<comment>{0} - interface name</comment>
362+
</data>
363+
<data name="JniMarshalMethodGen_JM8003" xml:space="preserve">
364+
<value>Caught an exception while loading types. The types that cannot be loaded will not be processed. Make sure that any additional assembly references required for those types are provided using the -r option. Exception:{0}{1}</value>
365+
<comment>{0} - newline, {1} - exception. The following terms should not be translated: -r</comment>
366+
</data>
367+
<data name="JniMarshalMethodGen_JM8004" xml:space="preserve">
368+
<value>Unable to find type '{0}'. The type will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</value>
369+
<comment>{0} - type
370+
The following terms should not be translated: -L</comment>
371+
</data>
372+
<data name="JniMarshalMethodGen_JM8005" xml:space="preserve">
373+
<value>Marshal methods type '{0}' already exists. Skipped generation of marshal methods in assembly '{1}'. Use -f to force regeneration when desired.</value>
374+
<comment>{0} - type, {1} - assembly name. The following terms should not be translated: -f. In this message, the term "marshal methods" refers to methods that allow interaction between the managed methods and Java methods, similar to the methods of the .NET System.Runtime.InteropServices.Marshal class.</comment>
375+
</data>
376+
<data name="JniMarshalMethodGen_JM8006" xml:space="preserve">
377+
<value>Unable to find definition of method '{0}' in assembly metadata. It will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</value>
378+
<comment>{0} - method
379+
The following terms should not be translated: -L</comment>
380+
</data>
381+
<data name="JniMarshalMethodGen_JM8007" xml:space="preserve">
382+
<value>Unable to find the System.Console.WriteLine() method. Disabling debug injection. To enable debug injection, ensure the directory containing mscorlib is provided with the -L option.</value>
383+
<comment>The following terms should not be translated: -L</comment>
384+
</data>
335385
</root>

src/Java.Interop.Localization/xlf/Resources.cs.xlf

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,68 @@ Name, com.example.MyClass.</note>
263263
<target state="new">Cannot override Kotlin-generated method '{0}' because it is not a valid Java method name. This method can only be overridden from Kotlin.</target>
264264
<note>{0} - Kotlin method name.</note>
265265
</trans-unit>
266+
<trans-unit id="JniMarshalMethodGen_JM4001">
267+
<source>Unable to preload reference '{0}'.</source>
268+
<target state="new">Unable to preload reference '{0}'.</target>
269+
<note>{0} - assembly path</note>
270+
</trans-unit>
271+
<trans-unit id="JniMarshalMethodGen_JM4002">
272+
<source>Please specify at least one ASSEMBLY to process.</source>
273+
<target state="new">Please specify at least one ASSEMBLY to process.</target>
274+
<note>The following terms should not be translated or have any capitalization changes: ASSEMBLY. This is a special case for this particular message. In most messages, "assembly" would be translated.</note>
275+
</trans-unit>
276+
<trans-unit id="JniMarshalMethodGen_JM4003">
277+
<source>Unable to create Java VM{0}{1}</source>
278+
<target state="new">Unable to create Java VM{0}{1}</target>
279+
<note>{0} - newline, {1} - exception</note>
280+
</trans-unit>
281+
<trans-unit id="JniMarshalMethodGen_JM4004">
282+
<source>Unable to read profile file '{0}'.{1}{2}</source>
283+
<target state="new">Unable to read profile file '{0}'.{1}{2}</target>
284+
<note>{0} - path, {1} - newline, {2} - exception. In this message, the term "profile" refers to a customized list of types to process.</note>
285+
</trans-unit>
286+
<trans-unit id="JniMarshalMethodGen_JM4005">
287+
<source>Path '{0}' does not exist.</source>
288+
<target state="new">Path '{0}' does not exist.</target>
289+
<note>{0} - path</note>
290+
</trans-unit>
291+
<trans-unit id="JniMarshalMethodGen_JM4006">
292+
<source>Unable to process assembly '{0}'{1}{2}{1}{3}</source>
293+
<target state="new">Unable to process assembly '{0}'{1}{2}{1}{3}</target>
294+
<note>{0} - assembly, {1} - newline, {2} - exception message, {3} exception</note>
295+
</trans-unit>
296+
<trans-unit id="JniMarshalMethodGen_JM8001">
297+
<source>Couln't find interface {0}</source>
298+
<target state="new">Couln't find interface {0}</target>
299+
<note>{0} - interface name</note>
300+
</trans-unit>
301+
<trans-unit id="JniMarshalMethodGen_JM8003">
302+
<source>Caught an exception while loading types. The types that cannot be loaded will not be processed. Make sure that any additional assembly references required for those types are provided using the -r option. Exception:{0}{1}</source>
303+
<target state="new">Caught an exception while loading types. The types that cannot be loaded will not be processed. Make sure that any additional assembly references required for those types are provided using the -r option. Exception:{0}{1}</target>
304+
<note>{0} - newline, {1} - exception. The following terms should not be translated: -r</note>
305+
</trans-unit>
306+
<trans-unit id="JniMarshalMethodGen_JM8004">
307+
<source>Unable to find type '{0}'. The type will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</source>
308+
<target state="new">Unable to find type '{0}'. The type will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</target>
309+
<note>{0} - type
310+
The following terms should not be translated: -L</note>
311+
</trans-unit>
312+
<trans-unit id="JniMarshalMethodGen_JM8005">
313+
<source>Marshal methods type '{0}' already exists. Skipped generation of marshal methods in assembly '{1}'. Use -f to force regeneration when desired.</source>
314+
<target state="new">Marshal methods type '{0}' already exists. Skipped generation of marshal methods in assembly '{1}'. Use -f to force regeneration when desired.</target>
315+
<note>{0} - type, {1} - assembly name. The following terms should not be translated: -f. In this message, the term "marshal methods" refers to methods that allow interaction between the managed methods and Java methods, similar to the methods of the .NET System.Runtime.InteropServices.Marshal class.</note>
316+
</trans-unit>
317+
<trans-unit id="JniMarshalMethodGen_JM8006">
318+
<source>Unable to find definition of method '{0}' in assembly metadata. It will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</source>
319+
<target state="new">Unable to find definition of method '{0}' in assembly metadata. It will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</target>
320+
<note>{0} - method
321+
The following terms should not be translated: -L</note>
322+
</trans-unit>
323+
<trans-unit id="JniMarshalMethodGen_JM8007">
324+
<source>Unable to find the System.Console.WriteLine() method. Disabling debug injection. To enable debug injection, ensure the directory containing mscorlib is provided with the -L option.</source>
325+
<target state="new">Unable to find the System.Console.WriteLine() method. Disabling debug injection. To enable debug injection, ensure the directory containing mscorlib is provided with the -L option.</target>
326+
<note>The following terms should not be translated: -L</note>
327+
</trans-unit>
266328
</body>
267329
</file>
268330
</xliff>

src/Java.Interop.Localization/xlf/Resources.de.xlf

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,68 @@ Name, com.example.MyClass.</note>
263263
<target state="new">Cannot override Kotlin-generated method '{0}' because it is not a valid Java method name. This method can only be overridden from Kotlin.</target>
264264
<note>{0} - Kotlin method name.</note>
265265
</trans-unit>
266+
<trans-unit id="JniMarshalMethodGen_JM4001">
267+
<source>Unable to preload reference '{0}'.</source>
268+
<target state="new">Unable to preload reference '{0}'.</target>
269+
<note>{0} - assembly path</note>
270+
</trans-unit>
271+
<trans-unit id="JniMarshalMethodGen_JM4002">
272+
<source>Please specify at least one ASSEMBLY to process.</source>
273+
<target state="new">Please specify at least one ASSEMBLY to process.</target>
274+
<note>The following terms should not be translated or have any capitalization changes: ASSEMBLY. This is a special case for this particular message. In most messages, "assembly" would be translated.</note>
275+
</trans-unit>
276+
<trans-unit id="JniMarshalMethodGen_JM4003">
277+
<source>Unable to create Java VM{0}{1}</source>
278+
<target state="new">Unable to create Java VM{0}{1}</target>
279+
<note>{0} - newline, {1} - exception</note>
280+
</trans-unit>
281+
<trans-unit id="JniMarshalMethodGen_JM4004">
282+
<source>Unable to read profile file '{0}'.{1}{2}</source>
283+
<target state="new">Unable to read profile file '{0}'.{1}{2}</target>
284+
<note>{0} - path, {1} - newline, {2} - exception. In this message, the term "profile" refers to a customized list of types to process.</note>
285+
</trans-unit>
286+
<trans-unit id="JniMarshalMethodGen_JM4005">
287+
<source>Path '{0}' does not exist.</source>
288+
<target state="new">Path '{0}' does not exist.</target>
289+
<note>{0} - path</note>
290+
</trans-unit>
291+
<trans-unit id="JniMarshalMethodGen_JM4006">
292+
<source>Unable to process assembly '{0}'{1}{2}{1}{3}</source>
293+
<target state="new">Unable to process assembly '{0}'{1}{2}{1}{3}</target>
294+
<note>{0} - assembly, {1} - newline, {2} - exception message, {3} exception</note>
295+
</trans-unit>
296+
<trans-unit id="JniMarshalMethodGen_JM8001">
297+
<source>Couln't find interface {0}</source>
298+
<target state="new">Couln't find interface {0}</target>
299+
<note>{0} - interface name</note>
300+
</trans-unit>
301+
<trans-unit id="JniMarshalMethodGen_JM8003">
302+
<source>Caught an exception while loading types. The types that cannot be loaded will not be processed. Make sure that any additional assembly references required for those types are provided using the -r option. Exception:{0}{1}</source>
303+
<target state="new">Caught an exception while loading types. The types that cannot be loaded will not be processed. Make sure that any additional assembly references required for those types are provided using the -r option. Exception:{0}{1}</target>
304+
<note>{0} - newline, {1} - exception. The following terms should not be translated: -r</note>
305+
</trans-unit>
306+
<trans-unit id="JniMarshalMethodGen_JM8004">
307+
<source>Unable to find type '{0}'. The type will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</source>
308+
<target state="new">Unable to find type '{0}'. The type will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</target>
309+
<note>{0} - type
310+
The following terms should not be translated: -L</note>
311+
</trans-unit>
312+
<trans-unit id="JniMarshalMethodGen_JM8005">
313+
<source>Marshal methods type '{0}' already exists. Skipped generation of marshal methods in assembly '{1}'. Use -f to force regeneration when desired.</source>
314+
<target state="new">Marshal methods type '{0}' already exists. Skipped generation of marshal methods in assembly '{1}'. Use -f to force regeneration when desired.</target>
315+
<note>{0} - type, {1} - assembly name. The following terms should not be translated: -f. In this message, the term "marshal methods" refers to methods that allow interaction between the managed methods and Java methods, similar to the methods of the .NET System.Runtime.InteropServices.Marshal class.</note>
316+
</trans-unit>
317+
<trans-unit id="JniMarshalMethodGen_JM8006">
318+
<source>Unable to find definition of method '{0}' in assembly metadata. It will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</source>
319+
<target state="new">Unable to find definition of method '{0}' in assembly metadata. It will not be processed. Make sure the directories for all referenced assemblies are provided with the -L option.</target>
320+
<note>{0} - method
321+
The following terms should not be translated: -L</note>
322+
</trans-unit>
323+
<trans-unit id="JniMarshalMethodGen_JM8007">
324+
<source>Unable to find the System.Console.WriteLine() method. Disabling debug injection. To enable debug injection, ensure the directory containing mscorlib is provided with the -L option.</source>
325+
<target state="new">Unable to find the System.Console.WriteLine() method. Disabling debug injection. To enable debug injection, ensure the directory containing mscorlib is provided with the -L option.</target>
326+
<note>The following terms should not be translated: -L</note>
327+
</trans-unit>
266328
</body>
267329
</file>
268330
</xliff>

0 commit comments

Comments
 (0)