import useEngineContext from "./useEngineContext.js";
//#region src/hooks/useLocale.ts
const useLocale = () => {
	var _context$appHelper, _app$locales, _context$engine;
	const context = useEngineContext();
	const { getApp } = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
	const app = getApp && (getApp === null || getApp === void 0 ? void 0 : getApp()) || {};
	if (app === null || app === void 0 || (_app$locales = app.locales) === null || _app$locales === void 0 ? void 0 : _app$locales.getLocale) {
		var _app$locales2, _app$locales2$getLoca;
		return app === null || app === void 0 || (_app$locales2 = app.locales) === null || _app$locales2 === void 0 || (_app$locales2$getLoca = _app$locales2.getLocale) === null || _app$locales2$getLoca === void 0 ? void 0 : _app$locales2$getLoca.call(_app$locales2);
	}
	return (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en";
};
//#endregion
export { useLocale as default };
