import { useTranslation } from "react-i18next";
/**
 * Hook that returns helpers to translate arbitrary user-facing strings using
 * the active i18next instance.
 *
 * The translation lookup uses the entire string as a flat key (keySeparator and
 * nsSeparator are disabled per call) so titles like "v1.0" or "Active Incidents"
 * work without nested-key confusion. If no translation entry exists, the original
 * string is returned.
 */
const useTranslateValue = () => {
    const { t } = useTranslation();
    const translateString = (value) => {
        if (typeof value !== "string" || value.length === 0) {
            return value;
        }
        const translated = t(value, {
            defaultValue: value,
            keySeparator: false,
            nsSeparator: false,
        });
        if (typeof translated !== "string") {
            return value;
        }
        return translated;
    };
    const translateValue = (value) => {
        if (typeof value === "string") {
            return translateString(value);
        }
        return value;
    };
    return { translateValue, translateString };
};
export default useTranslateValue;
//# sourceMappingURL=Translation.js.map