locked
c++ metro style app localization

    Question

  • I'm developing a windows style app in c++.  The localization mechanism works for the most part but I have an issue that I've been unable to resolve to do with attached properties.  I'm attempting to localise the labels in app bar buttons that have been created using the AppBarButtonStyle that is included in StandardStyles.xaml.  My problem is near identical to the issue described here http://stackoverflow.com/questions/10055145/windows-8-metro-appbar-buttons-localization.  The only difference that I can see is that I'm developing in c++ rather than c#.

    This works as expected:

    <Button x:Name="MyButton" Style="{StaticResource AppBarButtonStyle}" AutomationProperties.Name="my label text">

    This results in an empty label:

    xaml : <Button x:Name="MyButton" x:Uid="MyButtonId" Style="{StaticResource AppBarButtonStyle}" />
    resw : MyButtonId.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name | my label text

    Anyone have any ideas?
    Thursday, May 17, 2012 3:17 PM

Answers

  • Hello,

    I cannot reproduce your issue, I copy your code to Application resources and localization sample
    http://code.msdn.microsoft.com/windowsapps/Application-resources-and-cd0c6eaa

    And get the name with AutomationProperties.GetName method function, but cannot reproduce your issue. I would suggest you to check the resource file load part in your codes.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Friday, June 01, 2012 8:04 AM
    Friday, May 18, 2012 7:08 AM
  • The fix was to use Resources.resw as the file name for resources instead of Strings.resw.
    • Proposed as answer by Mike Wednesday, May 23, 2012 3:15 AM
    • Marked as answer by Jesse Jiang Friday, June 01, 2012 8:05 AM
    Monday, May 21, 2012 10:02 PM

All replies

  • Hello,

    I cannot reproduce your issue, I copy your code to Application resources and localization sample
    http://code.msdn.microsoft.com/windowsapps/Application-resources-and-cd0c6eaa

    And get the name with AutomationProperties.GetName method function, but cannot reproduce your issue. I would suggest you to check the resource file load part in your codes.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Jesse Jiang Friday, June 01, 2012 8:04 AM
    Friday, May 18, 2012 7:08 AM
  • The fix was to use Resources.resw as the file name for resources instead of Strings.resw.
    • Proposed as answer by Mike Wednesday, May 23, 2012 3:15 AM
    • Marked as answer by Jesse Jiang Friday, June 01, 2012 8:05 AM
    Monday, May 21, 2012 10:02 PM