简体   繁体   中英

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}}">

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM