import useEngineContext from "../../../hooks/useEngineContext";
export var useTranslation = function useTranslation() {
  var context = useEngineContext();
  return function (val) {
    var _context$appHelper;
    var translation = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.translation;
    if (translation) return translation(val);
    if (!val) return '';
    if (typeof val === 'string') return val;
    return val.original || val.en || val['zh-CN'] || '';
  };
};