"use strict";
const uni_modules_uviewPro_libs_util_configProvider = require("../util/config-provider.js");
function useLocale(namespace) {
  const createTranslateFunction = (ns) => {
    return (key, replacements, localeName) => {
      const fullKey = ns ? `${ns}.${key}` : key;
      return uni_modules_uviewPro_libs_util_configProvider.configProvider.t(fullKey, replacements, localeName);
    };
  };
  return {
    // 响应式引用
    currentLocale: uni_modules_uviewPro_libs_util_configProvider.configProvider.currentLocaleRef,
    locales: uni_modules_uviewPro_libs_util_configProvider.configProvider.localesRef,
    // 方法
    t: createTranslateFunction(namespace),
    setLocale: (name) => uni_modules_uviewPro_libs_util_configProvider.configProvider.setLocale(name),
    getLocales: () => uni_modules_uviewPro_libs_util_configProvider.configProvider.getLocales(),
    getCurrentLocale: () => uni_modules_uviewPro_libs_util_configProvider.configProvider.getCurrentLocale(),
    initLocales: (locales, defaultLocaleName, isForce) => uni_modules_uviewPro_libs_util_configProvider.configProvider.initLocales(locales, defaultLocaleName, isForce)
  };
}
exports.useLocale = useLocale;
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-pro/libs/hooks/useLocale.js.map
