ComPDFKit Web SDK
    Preparing search index...

    Function addLanguage

    • Adds a language to the language dropdown (an item with the same code is replaced). When the language is selected, its pack locales/translation-{code}.json is loaded from the WebViewer path unless its translations were given with setTranslations.

      Parameters

      Returns void

      instance.UI.addLanguage({ code: 'de', name: 'Deutsch' });
      instance.UI.setTranslations('de', { common: { actions: { save: 'Speichern', cancel: 'Abbrechen' } } });
      await instance.UI.setLanguage('de');