thsieh
thsieh

Reputation: 620

How to localize text in XAML for windows phone

I am trying to localize strings in XAML. So I modified the default string of ApplicationTitle in AppResource.zh-Hans.resx. After configuring device to proper phone language to Chinese Simplified, the application title shows OK.

However, when I tried to do the same trick to modify title of my pivot item, it doesn't show what I want. I just added a string (AllSongs) in the AppResource.zh-Hans.resx. and do the following modification. What have I missed? In Solution Explorer, the auto generated "AppResources.zh-Hans.Designer.cs" is empty. Do I need to add anything?? Thanks!

        <phone:Pivot x:Name="ListView" Title="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}" Grid.Row="0" SelectionChanged="View_selection_changed" >
        <!--Pivot item one-->
        <phone:PivotItem Header="{Binding Path=LocalizedResources.AllSongs, Source={StaticResource LocalizedStrings}}">

Upvotes: 2

Views: 1184

Answers (1)

Pedro Lamas
Pedro Lamas

Reputation: 7243

Did you remember to add the same AllSongs to the default AppResource.resx?

If you didn't add it to the default resource file, the designer won't be updated!

Upvotes: 1

Related Questions