From 0342fe5698b86e21e36c924732ff135b9a87e4af Mon Sep 17 00:00:00 2001 From: Brendan Zagaeski Date: Sat, 7 Dec 2019 10:58:58 -0800 Subject: [PATCH] [Xamarin.Android.Build.Tasks] Move XA4214 warning text into .resx file (#3900) Context: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1009374/ This is a first step toward localizing the MSBuild error and warning messages produced by `Xamarin.Android.Build.Tasks.dll`. We will be following the [.NET Resource Localization pattern][0] and generating satellite assemblies using [`.resx` files][1], in particular `src/Xamarin.Android.Build.Tasks/Properties/Resources.resx`. `Resources.resx` is an XML file, and will contain `/root/data` elements in which `//data/@name` will start with the Xamarin.Android error or warning code, and `//data/value` will be the error or warning message: The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. An optional `//data/comment` element may be provided to describe the meaning within the `//data/value` element to translators: The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. {0} - The managed type name {1} - Comma-separated list of all the assemblies where the managed type exists During the build, `Resources.resx` will be translated into a `Resources.Designer.cs` file: namespace Xamarin.Android.Tasks.Properties { internal partial class Resources { internal static string XA4214 { get => ... } } } The `Resources` members should be used to obtain all strings for use in `LogCodedError()` and `LogCodedWarning()` calls: Log.LogCodedWarning ("XA4214", Properties.Resources.XA4214, kvp.Key, string.Join (", ", kvp.Value)); When an MSBuild error or warning code is used with more than one output string, then a semantically meaningful suffix should be used to distinguish between the two: References to the type `{0}` will refer to `{0}, {1}`. Note that this infrastructure does not interoperate with C#6 string interpolation. Any error or warning messages currently using C#6 string interpolation will need to use .NET 1.0-style format strings. Our translation team doesn't work directly with `.resx` files. Instead, the translation team works with [XLIFF files][2]. `Resources.resx` is converted into a set of `src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.*.xlf` files via `XliffTasks.targets` from the [dotnet/xliff-tasks][3] repo. The `Resources.*.xlf` files should be automatically updated whenever `Resources.resx` is updated. Other: * This approach leaves the error code `XA4214` as a string literal for now. This differs from what dotnet/sdk and microsoft/msbuild do; they instead include the message code as part of the string resource in the `.resx` file. That might sometimes provide useful additional context for the translation team, but it also requires using a different set of logging methods from `Microsoft.Build.Utilities.TaskLoggingHelper`. * Fix the Test MSBuild Azure Pipelines build Specify the `feedsToUse` and `nugetConfigPath` inputs for the [`NuGetCommand@2`][6] Azure Pipelines task so that the NuGet restore step will be able to restore XliffTasks successfully from the dotnet-eng Azure DevOps NuGet package feed. This resolves the following error: The nuget command failed with exit code(1) and error(Errors in packages.config projects Unable to find version '1.0.0-beta.19252.1' of package 'XliffTasks'. C:\Users\dlab14\.nuget\packages\: Package 'XliffTasks.1.0.0-beta.19252.1' is not found on source 'C:\Users\dlab14\.nuget\packages\'. https://api.nuget.org/v3/index.json: Package 'XliffTasks.1.0.0-beta.19252.1' is not found on source 'https://api.nuget.org/v3/index.json'.) TODO: * When `Xamarin.Android.Build.Tasks.csproj` is converted into a [short-form project][4], add a dependency on dotnet/arcade and switch to using the [`GenerateResxSource` mechanism][5] instead of using `%(EmbeddedResource.Generator)`=ResXFileCodeGenerator and set `$(UsingToolXliff)`=True. This would match dotnet/sdk. [0]: https://docs.microsoft.com/dotnet/framework/resources/index [1]: https://docs.microsoft.com/dotnet/framework/resources/creating-resource-files-for-desktop-apps#resources-in-resx-files [2]: http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html [3]: https://github.com/dotnet/xliff-tasks [4]: https://docs.microsoft.com/visualstudio/msbuild/how-to-use-project-sdk [5]: https://github.com/dotnet/arcade/blob/e67d9f098029ebecedf11012a749b532d68ad2a9/Documentation/ArcadeSdk.md#generateresxsource-bool [6]: https://docs.microsoft.com/azure/devops/pipelines/tasks/package/nuget --- .gitattributes | 2 + Configuration.props | 5 + Documentation/README.md | 1 + .../images/resources-editor-xa0000.png | Bin 0 -> 11185 bytes Documentation/workflow/Localization.md | 73 ++++++++++ NuGet.config | 1 + .../setup-test-environment.yaml | 2 + .../installers/create-installers.targets | 2 + .../scripts/LocalizationLanguages.projitems | 5 + .../Properties/Resources.Designer.cs | 81 +++++++++++ .../Properties/Resources.resx | 131 ++++++++++++++++++ .../Properties/xlf/Resources.cs.xlf | 20 +++ .../Properties/xlf/Resources.de.xlf | 20 +++ .../Properties/xlf/Resources.es.xlf | 20 +++ .../Properties/xlf/Resources.fr.xlf | 20 +++ .../Properties/xlf/Resources.it.xlf | 20 +++ .../Properties/xlf/Resources.ja.xlf | 20 +++ .../Properties/xlf/Resources.ko.xlf | 20 +++ .../Properties/xlf/Resources.pl.xlf | 20 +++ .../Properties/xlf/Resources.pt-BR.xlf | 20 +++ .../Properties/xlf/Resources.ru.xlf | 20 +++ .../Properties/xlf/Resources.tr.xlf | 20 +++ .../Properties/xlf/Resources.zh-Hans.xlf | 20 +++ .../Properties/xlf/Resources.zh-Hant.xlf | 20 +++ .../Tasks/GenerateJavaStubs.cs | 9 +- .../Xamarin.Android.Build.Tasks.csproj | 16 +++ .../packages.config | 1 + 27 files changed, 582 insertions(+), 7 deletions(-) create mode 100644 Documentation/images/resources-editor-xa0000.png create mode 100644 Documentation/workflow/Localization.md create mode 100644 build-tools/scripts/LocalizationLanguages.projitems create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/Resources.resx create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf create mode 100644 src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf diff --git a/.gitattributes b/.gitattributes index 4831d8be183..fa7720b693b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,6 +19,8 @@ *.Designer.cs eol=crlf *.cs text +*.resx text +*.xlf text *.xml text *.md text Makefile eol=lf diff --git a/Configuration.props b/Configuration.props index 7eaf8110cb1..2895a5bc4d3 100644 --- a/Configuration.props +++ b/Configuration.props @@ -175,6 +175,11 @@ $(ManagedRuntime) $(ManagedRuntimeArgs) "$(RemapAssemblyRefToolExecutable)" + + cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant + true + + <_Runtime Condition=" '$(HostOS)' != 'Windows' ">$(ManagedRuntime) $(ManagedRuntimeArgs) diff --git a/Documentation/README.md b/Documentation/README.md index 23fa32810d9..cb1d20c0ad6 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -39,6 +39,7 @@ * [Using Your Build](workflow/UsingYourBuild.md) * [Jenkins Build Artifacts](workflow/JenkinsBuildArtifacts.md) * [Development tips and native debugging](workflow/DevelopmentTips.md) + * [Localization](workflow/Localization.md) # Coding Guidelines diff --git a/Documentation/images/resources-editor-xa0000.png b/Documentation/images/resources-editor-xa0000.png new file mode 100644 index 0000000000000000000000000000000000000000..1ebb2276295212b51a2a947e6ebb862b5660c4b8 GIT binary patch literal 11185 zcmbt)Wl&r}mo^e4xVr=i?(PH+&fr0VySpb4EVw&^Yp~$%5C-?)?l8E+u#k7ZKfATR zzFT$M?meeZ_31kDbcd@b$)F+;AwfYwp~`-iRE2_qnSX72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xuSxpY0%==t`njpz$XtWY00ESjeJ=*ZiWDg2(i!v*tdu;3y`52mXb2x7mi)5 zkTx~I*^0kI%9VP*C8OwRcD|QZ)!uMw`(R~0?to@E;wac|W2Evhq-y1=Z2Lm48*Q&s z6US|1d`m6DYB4_MC!_W3C*-_cvP#ADGpIP`$XEl<9YLV}Eb)WFO21vrQVLy!wi zd8@7UIyIClk4Lt6lOA}cRE<_Sn+XGP(bI`gK5N8hJl)i+FgF5@w7hCnwL9Yq7!yIay%7tE8G<=yEfK z@^pMHyY!u7Dyby$Cm(K4$4xnwj<8zag!Y_x4RXac@|k-9Z$UZK2idnW$7Ff6DYmQY zQ(oz4osONicZ)j1$HScbp&jSA&+i7qp*=Cw)z#l2AiSogi{o)rGWIrle@+Tx|NQxL zLxh;8Sw3lv@roVIh{*^BKzzl;VO~=LvUkNwS#nBBA=jjJtvkahYyCLR*Ss8d2%T{U zw(GncP(pmK*@@;&=+fI%`I^StDomeTnzNr(bAGpc>4;~l=MoLFeI6)QdV9rFE1}k zt?K6|e2n%lJ7KJ+51z2(s$Cc{<>)uAF{qN!XzF8mBhx8Wr2jFv6-CHt-t*(V$zZhK z-A3s1^Ye!IzZJDC*7Mtpb6 zNKfDFdA|7*mod!SZ d4SR?37!X5*zZ7ni=JrM@E2Sh^DgHI^zW@-ml9B)b literal 0 HcmV?d00001 diff --git a/Documentation/workflow/Localization.md b/Documentation/workflow/Localization.md new file mode 100644 index 00000000000..003fc31ce5a --- /dev/null +++ b/Documentation/workflow/Localization.md @@ -0,0 +1,73 @@ +# Localization + +All new Xamarin.Android MSBuild error or warning messages should be localizable, +so when adding a new message, follow these steps: + + 1. Add the new message to + `src/Xamarin.Android.Build.Tasks/Properties/Resources.resx`. Use the error + or warning code as the resource name. For example, for `XA0000`, use + `XA0000` as the name: + + ![Managed Resources Editor with XA0000 as the name for a + resource][resources-editor] + + Be sure to use Visual Studio or Visual Studio for Mac to edit the `.resx` + file so that the `ResXFileCodeGenerator` tool will run and update the + corresponding `Resources.Designer.cs` file. + + 2. Use the generated property from `Resources.Designer.cs` in the + `LogCodedError()` and `LogCodedWarning()` calls: + + ```csharp + Log.LogCodedError ("XA0000", Properties.Resources.XA0000); + ``` + + 3. After adding the new message, build `Xamarin.Android.Build.Tasks.csproj` + locally. This will run the targets from [dotnet/xliff-tasks][xliff-tasks] + to update the `.xlf` [XLIFF][xliff] localization files with the latest + changes from the `.resx` file. + + 4. Include the changes to the`.resx` file as well as the generated changes to + the `Resources.Designer.cs` file and the `.xlf` files in the commit. + +## Guidelines + + * When an error or warning code is used with more than one output string, use + semantically meaningful suffixes to distinguish the resource names. As a + made-up example: + + ```xml + + Invalid files. + + + Invalid directories. + + ``` + + * To include values of variables in the message, use numbered format items + like `{0}` and `{1}` rather than string interpolation or string + concatenation. + + The `.resx` infrastructure does not interoperate with C# 6 string + interpolation. + + String concatenation should also be avoided because it means splitting up + the message across multiple string resources, which makes it more + complicated to provide appropriate context to the translators. + + * Use the comments field in the `.resx` file to provide additional context to + the translators. For example, if a format item like `{0}` needs additional + explanation, add a comment: + + ``` + {0} - The managed type name + ``` + + For a few more examples, see the dotnet/sdk repo: + + https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/Resources/Strings.resx + +[resources-editor]: ../images/resources-editor-xa0000.png +[xliff-tasks]: https://github.com/dotnet/xliff-tasks +[xliff]: http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html diff --git a/NuGet.config b/NuGet.config index 33345bcfe1b..bf21c4d2f72 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,6 +3,7 @@ + \ No newline at end of file diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 46cac142d52..cb40baedcb8 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -37,6 +37,8 @@ steps: displayName: nuget restore Xamarin.Android solutions inputs: restoreSolution: '**/Xamarin.Android*.sln' + feedsToUse: config + nugetConfigPath: NuGet.config - task: MSBuild@1 displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj diff --git a/build-tools/installers/create-installers.targets b/build-tools/installers/create-installers.targets index 9cdfc0c9ae6..969ed663e7f 100644 --- a/build-tools/installers/create-installers.targets +++ b/build-tools/installers/create-installers.targets @@ -1,6 +1,7 @@ + @@ -195,6 +196,7 @@ <_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Bindings.targets" /> <_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Build.Tasks.dll" /> <_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Build.Tasks.pdb" /> + <_MSBuildFiles Include="@(_LocalizationLanguages->'$(MSBuildSrcDir)\%(Identity)\Xamarin.Android.Build.Tasks.resources.dll')" /> <_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.BuildInfo.txt" /> <_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Cecil.dll" /> <_MSBuildFiles Include="$(MSBuildSrcDir)\Xamarin.Android.Cecil.pdb" /> diff --git a/build-tools/scripts/LocalizationLanguages.projitems b/build-tools/scripts/LocalizationLanguages.projitems new file mode 100644 index 00000000000..c59c0cd78bd --- /dev/null +++ b/build-tools/scripts/LocalizationLanguages.projitems @@ -0,0 +1,5 @@ + + + <_LocalizationLanguages Include="$(XlfLanguages)" /> + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs new file mode 100644 index 00000000000..a623fc4c13c --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -0,0 +1,81 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Xamarin.Android.Tasks.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Xamarin.Android.Tasks.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical.. + /// + internal static string XA4214 { + get { + return ResourceManager.GetString("XA4214", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to References to the type `{0}` will refer to `{0}, {1}`.. + /// + internal static string XA4214_Result { + get { + return ResourceManager.GetString("XA4214_Result", resourceCulture); + } + } + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx new file mode 100644 index 00000000000..96ba0557699 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf new file mode 100644 index 00000000000..5b70d8b482e --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf new file mode 100644 index 00000000000..9f9427fec93 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf new file mode 100644 index 00000000000..37b2fd56747 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf new file mode 100644 index 00000000000..82c7982d5e9 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf new file mode 100644 index 00000000000..bb86d18d3b8 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf new file mode 100644 index 00000000000..9069103c3a2 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf new file mode 100644 index 00000000000..63fa0be61c3 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf new file mode 100644 index 00000000000..0a4ffa75b4d --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf new file mode 100644 index 00000000000..e27d677f03c --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf new file mode 100644 index 00000000000..b4a7a46023b --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf new file mode 100644 index 00000000000..65781e40289 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf new file mode 100644 index 00000000000..558f25dc655 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf new file mode 100644 index 00000000000..2618f7ceda8 --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf @@ -0,0 +1,20 @@ + + + + + + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + The managed type `{0}` exists in multiple assemblies: {1}. Please refactor the managed type names in these assemblies so that they are not identical. + {0} - The managed type name +{1} - Comma-separated list of all the assemblies where the managed type exists + + + References to the type `{0}` will refer to `{0}, {1}`. + References to the type `{0}` will refer to `{0}, {1}`. + The phrase "`{0}, {1}`" does not need to be translated. +{0} - The managed type name +{1} - The the name of the library that contains the type + + + + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs index a482b0c5509..35453d5eb46 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs @@ -220,13 +220,8 @@ void Run (DirectoryAssemblyResolver res) } foreach (var kvp in managedConflicts) { - Log.LogCodedWarning ( - "XA4214", - "The managed type `{0}` exists in multiple assemblies: {1}. " + - "Please refactor the managed type names in these assemblies so that they are not identical.", - kvp.Key, - string.Join (", ", kvp.Value)); - Log.LogCodedWarning ("XA4214", "References to the type `{0}` will refer to `{0}, {1}`.", kvp.Key, kvp.Value [0]); + Log.LogCodedWarning ("XA4214", Properties.Resources.XA4214, kvp.Key, string.Join (", ", kvp.Value)); + Log.LogCodedWarning ("XA4214", Properties.Resources.XA4214_Result, kvp.Key, kvp.Value [0]); } foreach (var kvp in javaConflicts) { diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj index bbd668e46cb..f0c6bec6b2e 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj @@ -1,6 +1,7 @@ + Debug AnyCPU @@ -16,6 +17,7 @@ True + @@ -186,6 +188,11 @@ + + True + True + Resources.resx + @@ -592,6 +599,14 @@ + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + <_MonoAndroidEnum Include="$(AndroidGeneratedClassDirectory)\Android.Content.PM.LaunchMode.cs" /> <_MonoAndroidEnum Include="$(AndroidGeneratedClassDirectory)\Android.Content.PM.ScreenOrientation.cs" /> @@ -761,4 +776,5 @@ + diff --git a/src/Xamarin.Android.Build.Tasks/packages.config b/src/Xamarin.Android.Build.Tasks/packages.config index 50cc584ff80..7e11ec8cf75 100644 --- a/src/Xamarin.Android.Build.Tasks/packages.config +++ b/src/Xamarin.Android.Build.Tasks/packages.config @@ -26,4 +26,5 @@ + \ No newline at end of file