From 0c6877168d70f6bd4325794ca6ec73869676bbcf Mon Sep 17 00:00:00 2001 From: Yumin Cho Date: Thu, 14 Mar 2024 00:29:25 +0900 Subject: [PATCH] docs: add docstring for useTranslatedString hook --- src/hooks/useTranslatedString.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/hooks/useTranslatedString.tsx b/src/hooks/useTranslatedString.tsx index ed1a44b..5c2b45e 100644 --- a/src/hooks/useTranslatedString.tsx +++ b/src/hooks/useTranslatedString.tsx @@ -1,5 +1,12 @@ import { useTranslation } from 'react-i18next'; +/** + * Custom hook that returns a function for translating strings based on the current language. + * + * @returns {function} A function that takes an object and a key and returns the translated string. + * @example const translate = useTranslatedString(); + * const translatedString = translate(review.lecture, 'title'); + */ export const useTranslatedString = () => { const { i18n } = useTranslation();