Localisation and Globalisation

Create String Resources

  • {project}/Strings/en-US/Resources.resw

Use Resource Loader

async void Alert(string message)
{
  var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
  var title = loader.GetString(string.Format("{0}.Title", messageID));
  var message = loader.GetString(string.Format("{0}.Message", messageID));
  var button = loader.GetString(string.Format("{0}.Button", messageID));
  var dialog = new ContentDialog
  {
    Title = title,
    Content = message,
    PrimaryButtonText = button
  };

  await dialog.ShowAsync();
}