Editare

Partajați prin


MergeLocalizationDirectives task

The MergeLocalizationDirectives task merges the localization attributes and comments of one or more XAML binary format files into a single file for the whole assembly.

Task parameters

Parameter Description
GeneratedLocalizationFiles Required ITaskItem[] parameter.

Specifies the list of localization directives files for individual files in XAML binary format.
OutputFile Required String output parameter.

Specifies the output path of the compiled localization-directives assembly.

Remarks

You can add localization attributes and comments to XAML content. With Windows Presentation Foundation (WPF) localization support, you can strip out localization attributes and comments, and put them in a .loc file that is separate from the generated assembly. You can do this by using the LocalizationPropertyStorage attribute. For more information about localization attributes and comments, and LocalizationPropertyStorage, see Localization attributes and comments.

Example

The following example merges the localization comments of several XAML binary format files into a single .loc file.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask
    TaskName="Microsoft.Build.Tasks.Windows.MergeLocalizationDirectives"
    AssemblyFile="C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationBuildTasks.dll" />
  <Target Name="MergeLocalizationDirectivesTask">
    <MergeLocalizationDirectives
      GeneratedLocalizationFiles="obj\debug\page1.loc;obj\debug\page2.loc;obj\debug\page3.loc"
      OutputFile="obj\debug\WPFMSBuildSample.loc" />
  </Target>
</Project>

See also