You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆕 Added support for JSON5
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ILocalizationManager } from '@nitrots/api';
|
||||
import { BadgePointLimitsEvent, GetCommunication } from '@nitrots/communication';
|
||||
import { GetConfiguration } from '@nitrots/configuration';
|
||||
import { parseConfigJsonFromResponse } from '@nitrots/utils';
|
||||
import { BadgeBaseAndLevel } from './BadgeBaseAndLevel';
|
||||
|
||||
export class LocalizationManager implements ILocalizationManager
|
||||
@@ -42,11 +43,11 @@ export class LocalizationManager implements ILocalizationManager
|
||||
|
||||
try
|
||||
{
|
||||
data = await response.json();
|
||||
data = await parseConfigJsonFromResponse(response, url);
|
||||
}
|
||||
catch(parseErr)
|
||||
{
|
||||
throw new Error(`Invalid JSON in localization file "${ url }" — the URL may be wrong. Check "external.texts.url" in ui-config.json (${ parseErr.message })`);
|
||||
throw new Error(`Invalid localization file "${ url }" — JSON/JSON5 parse failed. Check "external.texts.url" in ui-config.json (${ parseErr.message })`);
|
||||
}
|
||||
|
||||
this.parseLocalization(data);
|
||||
|
||||
Reference in New Issue
Block a user