Localization: Change languages in our UWP viewer

PSPDFKit for Windows comes with many built-in languages:

  • Chinese Simplified / Chinese Traditional (zh-Hans/zh-Hant)

  • Croatian (hr)

  • Czech (cs)

  • Danish (da)

  • Dutch (nl)

  • English (en)

  • English United Kingdom (en-GB)

  • Finnish (fi)

  • French (fr)

  • German (de)

  • Greek (el)

  • Indonesian (id)

  • Italian (it)

  • Japanese (ja)

  • Korean (ko)

  • Malay (ms)

  • Norwegian Bokmål (nb-NO)

  • Polish (pl)

  • Portuguese Brazil / Portugal (pt-BR/pt-PT)

  • Russian (ru)

  • Slovak (sk)

  • Slovenian (sl)

  • Spanish (es)

  • Swedish (sv)

  • Thai (th)

  • Turkish (tr)

  • Ukrainian (uk)

  • Welsh (cy)

Forcing a Specific Language

By default, the PdfView localization will mirror the CurrentUICulture of your UWP application. There are two ways of overriding this default locale.

The first way is through the ViewState when showing a new document:

await PDFView.Controller.ShowDocumentWithViewStateAsync(documentSource, new ViewState
{
    Locale = "nl"
});

The second way is at runtime, through the Controller, after the UI is displayed:

PDFView.OnDocumentOpened += async (pdfView, document) =>
{
    await pdfView.Controller.SetLocaleAsync("pt-BR");
};

If either your application language or the language specified are not supported, the PdfView will automatically detect the closest language. If it is unable to, the locale will default to English.

To get a list of supported locales at runtime, you can use the following:

await PDFView.Controller.GetSupportedLocalesAsync();

The current PdfView locale code is also available:

await PDFView.Controller.GetCurrentLocaleAsync();