How to change language for Viewer API in .NET

Hi there,

Is it possible to change the language (culture) of the viewer interface?

If so, how is this done, and what are the supported languages?

Apologies for the simple question - but I couldn’t find any information about this in the documentation for the life of me.

@dan.betterimpact

Thank you for your interest in GroupDocs.Viewer! Are you talking about client-side Angular UI?

I am talking about the on-premise GroupDocs.Viewer for .NET: .NET Document Viewer API, Render PDF Word Excel Image HTML Diagram

We will be using ASP.NET MVC, if that is relevant.

Thanks!

@dan.betterimpact

By default we’re using current thread culture. Please let us know in case you have issues with rendering and we’ll try assisting you.

As a side note, we have a public repository with demos at GitHub.

Great, thank you! That should work for our scenario.

Have you considered having a way to explicitly set the language for the viewer, though? That would be very handy for testing purposes, etc.

@dan.betterimpact

Sure, but can you please clarify what you want to achieve by changing a language?

To have the end user have labels, etc. in the interface available in their locale? We currently support English, French, Spanish, and Portuguese in our web application.

@dan.betterimpact

Thanks for the clarification. Since GroupDocs.Viewer for .NET is a converter that accepts a file on the input and produces HTML/PNG/JPG/PDF on the output your request seem to be related to the Viewer’s client-side UI. As a client-side UI we’re using @groupdocs.examples.angular/viewer package. This package does not support changing a language at the moment. We’ve planned to add support for this feature and logged it in our internal bug-tracker with ID VIEWERNET-3582. In case of any updates, we’ll update you here.

Thank you for the clarification, that’s unfortunate :frowning:

@dan.betterimpact

You’re welcome!

@dan.betterimpact

The latest version of @groupdocs.examples.angular/viewer package adds multi-language support.

To give it a try please pull the latest version of the MVC Demo and set supported languages in configuration.yml to

  # Supported languages
  # English, French, Spanish, and Portuguese
  supportedLanguages: ["en", "fr", "es", "pt" ]

When you run the app you can select the language as shown on the screenshot

Please let us know if it fits your requirements.