1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00
* Fixed: Animated overlay emotes not working correctly.
* Fixed: Localization incorrectly using empty strings for some languages.
This commit is contained in:
SirStendec 2021-12-13 13:41:51 -05:00
parent 8758710dce
commit cc649252db
2 changed files with 12 additions and 19 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.31.2", "version": "4.31.3",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true, "private": true,
"license": "Apache-2.0", "license": "Apache-2.0",

View file

@ -15,8 +15,6 @@ import NewTransCore from 'utilities/translation-core';
const fetchJSON = (url, options) => fetch(url, options).then(r => r.ok ? r.json() : null).catch(() => null); const fetchJSON = (url, options) => fetch(url, options).then(r => r.ok ? r.json() : null).catch(() => null);
const API_SERVER = 'https://api-test.frankerfacez.com';
const STACK_SPLITTER = /\s*at\s+(.+?)\s+\((.+)\)$/, const STACK_SPLITTER = /\s*at\s+(.+?)\s+\((.+)\)$/,
SOURCE_SPLITTER = /^(.+):\/\/(.+?)(?:\?[a-zA-Z0-9]+)?:(\d+:\d+)$/; SOURCE_SPLITTER = /^(.+):\/\/(.+?)(?:\?[a-zA-Z0-9]+)?:(\d+:\d+)$/;
@ -691,29 +689,24 @@ export class TranslationManager extends Module {
const chunks = await Promise.all(promises); const chunks = await Promise.all(promises);
const result = {}; const result = {};
let ignored = 0;
for(const chunk of chunks) { for(const chunk of chunks) {
if (! chunk) if (! chunk)
continue; continue;
for(const [key,val] of Object.entries(chunk)) for(const [key,val] of Object.entries(chunk)) {
if (typeof val === 'string' && val.length > 0)
result[key] = val; result[key] = val;
else
ignored++;
} }
}
if (ignored > 0)
this.log.debug(`Ignored ${ignored} invalid values while loading ${locale} chunks.`);
return result; return result;
/*const resp = await fetch(`${API_SERVER}/v2/i18n/locale/${locale}`);
if ( ! resp.ok ) {
if ( resp.status === 404 ) {
this.log.info(`Cannot Load Locale: ${locale}`);
return {};
}
this.log.warn(`Cannot Load Locale: ${locale} -- Status: ${resp.status}`);
throw new Error(`http error ${resp.status} loading phrases`);
}
const data = await resp.json();
return data?.phrases;*/
} }
async setLocale(new_locale) { async setLocale(new_locale) {