BeefreeSDK / beefree-sdk-npm-official

Official NPM package of Beefree SDK
https://developers.beefree.io
Apache License 2.0
19 stars 7 forks source link

feat(multilanguage): switch template language method #134

Closed simcen closed 7 months ago

simcen commented 8 months ago

Description

Adds type specifications for switchTemplateLanguage method

Motivation and Context

Fully leverage multi language templates

Usage examples

import BeePLugin from '@mailupinc/bee-plugin'

const beePlugin = new BeePlugin()
beePlugin.getToken()

const beeConfig :IBeeConfig = {
templateLanguage: { value: "de-DE", label: "Deutsch" },
  templateLanguages: [
      { value: "de-DE", label: "Deutsch" },
      { value: "fr-FR", label: "Français" },
      { value: "it-IT", label: "Italiano" }
  ],
}

beeTest.switchTemplateLanguage({language: "de-DE"});

How Has This Been Tested?

Extended example application with a language switcher that executes switchTemplateLanguage({language: "de-DE"}) on the bee instance

Types of changes

pinkynrg commented 7 months ago

This update has just been released in version 3.1.0. In addition to your modification, we've also included the "switchPreview" method to enable language switching while in preview mode.

Closing.