Fix empty badge name & desc

This commit is contained in:
Bill 2022-03-16 05:20:39 -04:00
parent 6baa7207e1
commit 6394b9d2f4
2 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,10 @@
import { GetNitroInstance } from '..';
export function LocalizeBadgeDescription(key: string): string
export const LocalizeBadgeDescription = (key: string) =>
{
return GetNitroInstance().localization.getBadgeDesc(key);
let badgeDesc = GetNitroInstance().localization.getBadgeName(key);
if(!badgeDesc || !badgeDesc.length) badgeDesc = `badge_desc_${ key }`;
return badgeDesc;
}

View File

@ -1,6 +1,10 @@
import { GetNitroInstance } from '..';
export function LocalizeBadgeName(key: string): string
export const LocalizeBadgeName = (key: string) =>
{
return GetNitroInstance().localization.getBadgeName(key);
let badgeName = GetNitroInstance().localization.getBadgeName(key);
if(!badgeName || !badgeName.length) badgeName = `badge_name_${ key }`;
return badgeName;
}