adnbn
Version: 
Addon Bone - Cross-browser web extension framework with shared code base
29 lines • 801 B
JavaScript
import { NativeLocale } from "./../locale/providers/index.js";
import { convertLocaleMessageKey, extractLocaleKey } from "./../locale/utils.js";
const _ = (key, substitutions) => {
  return NativeLocale.getInstance().trans(key, substitutions);
};
const _c = (key, count, substitutions) => {
  return NativeLocale.getInstance().choice(key, count, substitutions);
};
const __ = (key) => {
  const locale = NativeLocale.getInstance();
  if (!locale.keys().has(key)) {
    console.warn(`Locale key "${key}" not found in "${locale.lang()}" language.`);
  }
  return convertLocaleMessageKey(key);
};
const __t = (input) => {
  const localeKey = extractLocaleKey(input);
  if (localeKey) {
    return _(localeKey);
  }
  return input;
};
export {
  _,
  __,
  __t,
  _c
};
//# sourceMappingURL=helpers.js.map