Fix the localization function and provide a special placeholder for when the user doesn't have a die assigned to their stat

This commit is contained in:
Oliver-Akins 2024-03-02 00:28:23 -07:00
parent c1ee1a9ef8
commit 2065596686
6 changed files with 71 additions and 40 deletions

View file

@ -14,8 +14,8 @@ export function localizer(key, args = {}, depth = 0) {
const subkey = match.groups.key;
localized =
localized.slice(0, match.index)
+ localizer(subkey.slice(1), args, depth + 1)
+ localized.slice(match.index + subkey.length)
+ localizer(subkey, args, depth + 1)
+ localized.slice(match.index + subkey.length + 1)
};
return localized;
};