0

I am using the Windows Phone Toolkit and added the Date Picker Control. The Control itself shows Date and Day as translated strings already but the App Bar Icons below have "done" and "cancel" in all languages. I downloaded the Source Code from codeplex and ran the project there and could see a translated text. For some reason this does not work in my project where I installed the toolkit via NuGet manager.

Is there a way to replace this hard coded text with a style/template?

<shell:ApplicationBarIconButton
       IconUri="/Toolkit.Content/ApplicationBar.Check.png"
       Text="DONE"/>
<shell:ApplicationBarIconButton
       IconUri="/Toolkit.Content/ApplicationBar.Cancel.png"
       Text="CANCEL"/>
venerik
  • 5,766
  • 2
  • 33
  • 43
eX0du5
  • 896
  • 7
  • 16

1 Answers1

0

You will have to select the languages you want to support in your project file. For instance, if you would like to support Dutch, you should select Dutch (Netherlands) in the project file (Application tab, Supported Cultures list).

After saving this change, Visual Studio will automatically add a culture specific resource file for you. E.g. AppResources.nl-NL.resx.

After building and deploying the solution the toolkit's culture specific resources will be included in your XAP file and the date picker should display the correct text.

Source: http://phone.codeplex.com/workitem/10893

venerik
  • 5,766
  • 2
  • 33
  • 43
  • This is what I have done. Because of that, the tiles already show the day and the month in the correct language. But the application bar buttons still show "done" and "cancel". – eX0du5 Dec 06 '13 at 08:36
  • What language do you want to use for your controls? – venerik Dec 07 '13 at 14:31
  • German, English and some others - all are part of the toolkit library but somehow not translated when included as nuget package. – eX0du5 Dec 08 '13 at 20:04
  • Ok, what I did to get it working. Create a new Windows Phone project. Include the toolkit using NuGet. Add a DatePicker to the MainPage.xaml. Run the project, turn emulator in German (language and country). The date is German, the header and app bar texts are English. Now add language German (Germany) to project. This adds AppResources.de-DE.resx to the project. Run emulator again. Texts are German(Datum Wählen, Fertig, Abbrechen). Be sure to select a Language and Country in your project. I tried French without a region but that doesn't work. Good luck. – venerik Dec 08 '13 at 20:42
  • It does not add any AppResources file to my project when I enable Germany (German) - besides "Germany". This might be because the Phone App also uses a portable class library which contains the translations for the whole app. But I wonder why it cannot "simply" use the AppResources.de-DE provided by the toolkit additionally to mine or add a reference to it in my project. – eX0du5 Dec 10 '13 at 14:34