import englishResources from "../statics/locale/messages_en.json.js";
const fetchEditorTranslations = async (locale = "en") => {
  const englishTranslations = {
    locale: "en",
    localeResource: englishResources
  };
  if (locale === "en") {
    return englishTranslations;
  }
  if (locale === "cimode") {
    return {
      locale: "cimode",
      localeResource: englishResources
    };
  }
  try {
    const localeResource = await import(
      /* webpackChunkName: "ricos_editor_messages_[request]" */
      `../statics/locale/messages_${locale}.json`
    ).then((res) => res.default);
    return { locale, localeResource };
  } catch (err) {
    console.warn(`can't find ${locale} locale`, err);
    return englishTranslations;
  }
};
export {
  fetchEditorTranslations
};
//# sourceMappingURL=fetch-editor-translations.js.map
