mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 05:15:54 +00:00
4.31.3
* Fixed: Animated overlay emotes not working correctly. * Fixed: Localization incorrectly using empty strings for some languages.
This commit is contained in:
parent
8758710dce
commit
cc649252db
2 changed files with 12 additions and 19 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "frankerfacez",
|
||||
"author": "Dan Salvato LLC",
|
||||
"version": "4.31.2",
|
||||
"version": "4.31.3",
|
||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
|
|
29
src/i18n.js
29
src/i18n.js
|
@ -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 API_SERVER = 'https://api-test.frankerfacez.com';
|
||||
|
||||
const STACK_SPLITTER = /\s*at\s+(.+?)\s+\((.+)\)$/,
|
||||
SOURCE_SPLITTER = /^(.+):\/\/(.+?)(?:\?[a-zA-Z0-9]+)?:(\d+:\d+)$/;
|
||||
|
||||
|
@ -691,29 +689,24 @@ export class TranslationManager extends Module {
|
|||
const chunks = await Promise.all(promises);
|
||||
const result = {};
|
||||
|
||||
let ignored = 0;
|
||||
|
||||
for(const chunk of chunks) {
|
||||
if (! chunk)
|
||||
continue;
|
||||
|
||||
for(const [key,val] of Object.entries(chunk))
|
||||
result[key] = val;
|
||||
for(const [key,val] of Object.entries(chunk)) {
|
||||
if (typeof val === 'string' && val.length > 0)
|
||||
result[key] = val;
|
||||
else
|
||||
ignored++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ignored > 0)
|
||||
this.log.debug(`Ignored ${ignored} invalid values while loading ${locale} chunks.`);
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue