#1,126 – Localization VII – Preventing Translator from Modifying Certain Elements

By default, when a .csv file is created using the LocBaml tool, the fifth parameter on each line is set to True.  This parameter indicates whether a particular property should be modifiable by the translator.

You can change the value of this modifiable field by setting the Localization.Attributes property for an element.  This property is set to a string of the form “propname(locvalue1 locvalue2) propname(locvalue1 locvalue2)”.

One of the localizability values that you can set is Unmodifiable, to indicate that the specified property should not be modified by the translator.

Below, we set Unmodifiable for various property values.

<Window x:Uid="Window_1" x:Class="WpfApplication1.MainWindow"
        Localization.Attributes="$Content(Unmodifiable) SizeToContent(Unmodifiable)"
        Title="The App" SizeToContent="WidthAndHeight">

    <StackPanel x:Uid="StackPanel_1" Margin="15"
        <Label x:Uid="Label_1" Content="Hello, I like apples."
        <Button x:Uid="Button_1" Content="Learn More" Margin="5"
                Localization.Attributes="$Content(Unmodifiable) Margin(Unmodifiable)"/>

After running the LocBaml tool, we see that the modifiable field is now false for these properties.