fix: use translate prefix correction

This commit is contained in:
Timothy Z. 2026-02-03 16:44:25 +08:00
parent 0df0cdb44b
commit e29adde4bd

View file

@ -9,7 +9,7 @@ const useTranslate = () => {
const string = useCallback((key) => t(key), [t]); const string = useCallback((key) => t(key), [t]);
const stringWithPrefix = useCallback((value, prefix, fallback = null) => { const stringWithPrefix = useCallback((value, prefix, fallback = null) => {
const key = `${prefix}${value}`; const key = `${prefix}_${value}`;
const defaultValue = fallback ?? value.charAt(0).toUpperCase() + value.slice(1); const defaultValue = fallback ?? value.charAt(0).toUpperCase() + value.slice(1);
return t(key, { return t(key, {