UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

36 lines (35 loc) 889 B
import { logger as N } from "../../shared-lib/index.js"; import zt from "../common/translations.js"; export default class nr { constructor(t, e = !1) { if ( ((this.language = t), null != t && (t = t.toLowerCase()), null != t && null == zt[t]) ) { const e = t.indexOf("-"); e > 0 && (t = t.substring(0, e)); } if (null == zt[t]) { const a = "Braze does not yet have a localization for language " + t + ", defaulting to English. Please contact us if you are willing and able to help us translate our SDK into this language."; e ? N.error(a) : N.info(a), (t = "en"); } this.language = t; } get(t) { return zt[this.language][t]; } Ro() { switch (this.language) { case "ar": case "he": case "fa": return "rtl"; default: return "ltr"; } } }