> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/get-started/samples/internationalization.md).

# Switch Toolbar Language - Internationalization

JavaScript sample to change the language displayed in the toolbar of a PDF Viewer. In this example toggle between English, French & Chinese Simplified

{% hint style="info" %}
**Requirements**

*These packages are required to use these features in production. Trial keys have unlimited access to all features*

<a href="/web/get-started/readme.md" class="button primary">Web SDK</a><a href="https://showcase.apryse.com/language-switcher" class="button primary">Live demo</a>
{% endhint %}

This JavaScript sample lets you change the language displayed in tooltips when viewing documents in PDF Viewer. Compatible with all browsers (including IE11) and mobile devices without using plug-ins.

Launch the [Internationalization Demo](https://showcase.apryse.com/language-switcher) to see an example of how you can toggle between English, French and Chinese Simplified in WebViewer.

Learn more about our [Web SDK](/web/get-started/guides.md).

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
// eslint-disable-next-line no-undef
const WebViewerConstructor = isWebComponent() ? WebViewer.WebComponent : WebViewer;

WebViewerConstructor(
  {
    path: '../../../lib',
    additionalTranslations: {
      language: 'en',
      translations: { 'option.toolbarGroup.toolbarGroup-View': 'Edited View Label' },
    },
    initialDoc: 'https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf',
  },
  document.getElementById('viewer')
).then(instance => {
  samplesSetup(instance);

  const currentLanguage = instance.UI.getCurrentLanguage();
  const radioButton = document.querySelector(`form > #${currentLanguage}`);
  if (radioButton) {
    radioButton.checked = true;
  }

  document.getElementById('form').onchange = e => {
    // Set language
    instance.UI.setLanguage(e.target.id);
  };
});
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/get-started/samples/internationalization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
