跳到主要内容

setLocale()

描述

为 Booking 应用新的语言环境

用法

setLocale(locale?: object | null): void;

参数

  • null - (可选)重置为默认语言环境(英语)
  • locale - (可选)要应用的新语言环境的数据对象

示例

// 创建 Booking
const widget = new booking.Booking("#root", {
data,
// 初始配置参数
});

// 为 Booking 应用 "de" 语言环境
widget.setLocale(booking.locales.de);

// 为 Booking 应用默认语言环境
widget.setLocale(); // 或 setLocale(null);

相关文章