How to tune addin using XamlParseInfo.xml

File XamlParseInfo.xml contains some definitions, which affects parsing of Xaml and substitution of localizable strings.
File XamlParseInfo.xml located in the same folder, where addin binaries are located.
Note: Some elements of XamlParseInfo.xml may be moved to settings UI in the future.

Frequently used strings (WellKnownStrings element)

Usually you will want to translate strings like "OK" and "Cancel", "Yes" and "No" single time for all entries.
To support this, you can define all your "well known strings" inside the WellKnownStrings element.
     <WellKnownString Text="OK" FullKey="YourAssemblyName:Resources:Ok" /> 
     <WellKnownString Text="Cancel" FullKey="YourAssemblyName:Resources:Cancel" /> 
     <WellKnownString Text="Yes" FullKey="YourAssemblyName:Resources:Yes" /> 
     <WellKnownString Text="No" FullKey="YourAssemblyName:Resources:No" /> 

Thus, every time addin finds string "OK", it will substitute it with reference to resource "YourAssemblyName:Resources:Ok" and will not extract it into new resource.
Note: you should create correspondent resource file and entries for "well know strings" on your own.

!!Elements section
You may find at some point, that addin doesn't recongnize some attributes of control as localizable.
In this case you may consider to explicitly specify such controls in Elements section of XamlParseInfo.xml.
Inside first definition, attributes, which are localizable for all controls, are defined:
     <Element Name="*">
        <Attribute Name="Content" /> 
        <Attribute Name="ToolTip" /> 
        <Attribute Name="Text" /> 
        <Attribute Name="Header" /> 
        <Attribute Name="Title" /> 

Below, some specific attributes of elements or controls are defined, e.g.:
  <Element Name="KeyBinding">
      <Attribute Name="KeyBinding.Key" /> 
      <Attribute Name="KeyBinding.Gesture" /> 

Replace settings

ReplaceSettings element contains some settings, which influence replacement of strings with LocText extention.
Particularly, you can set your prefered prefix insted of "loc".

Solution-specific XamlParseInfo.xml

Most likely you'll wish to have separate XamlParseInfo.xml file for each solution, particularly to have different WellKnownStrings.
Addin first tries to locate this file in the folder, where current solution (.sln file) is stored.
If solution-specific settings file not found, addin fallbacks to common XamlParseInfo.xml, stored in addin folder.

Last edited Feb 5, 2011 at 5:08 PM by skiba_k, version 6


No comments yet.