remade localization system once again
- new localization system: fast, dynamic, way more organized - localization strings are WAY more descriptive - it's now easier to add support for other languages (just one loc file instead of five) - localization now falls back to english if localized string isnt available - got rid of all static language selectors (probably) - slightly updated english and russian strings - miscellaneous settings items have been bundled together and moved to the bottom, cause they're used the least - bottom links should no longer touch the popup border on overflow - rearranged popup order in the rendered page - bumped version up to 2.2.5 if you see strings that are like this: !!EXAMPLE!! or withoutspace please file an issue on github
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import ytdl from "ytdl-core";
|
||||
import loc from "../sub/i18n.js";
|
||||
import loc from "../../localization/manager.js";
|
||||
import { maxVideoDuration, quality as mq } from "../config.js";
|
||||
import selectQuality from "../stream/selectQuality.js";
|
||||
|
||||
@@ -48,7 +48,7 @@ export default async function (obj) {
|
||||
filename: `youtube_${obj.id}_${videoMatch[0]["width"]}x${videoMatch[0]["height"]}.${obj.format}` };
|
||||
}
|
||||
} else {
|
||||
return { error: loc('en', 'apiError', 'errorFetch') };
|
||||
return { error: loc(obj.lang, 'ErrorBadFetch') };
|
||||
}
|
||||
} else if (!obj.isAudioOnly) {
|
||||
return { type: "render", urls: [video[0]["url"], audio[0]["url"]], time: video[0]["approxDurationMs"],
|
||||
@@ -56,19 +56,19 @@ export default async function (obj) {
|
||||
} else if (audio.length > 0) {
|
||||
return { type: "render", isAudioOnly: true, urls: [audio[0]["url"]], filename: `youtube_${obj.id}_${audio[0]["audioBitrate"]}kbps.opus` };
|
||||
} else {
|
||||
return { error: loc('en', 'apiError', 'errorFetch') };
|
||||
return { error: loc(obj.lang, 'ErrorBadFetch') };
|
||||
}
|
||||
} else {
|
||||
return { error: loc('en', 'apiError', 'lengthLimit', maxVideoDuration / 60000) };
|
||||
return { error: loc(obj.lang, 'ErrorLengthLimit', maxVideoDuration / 60000) };
|
||||
}
|
||||
} else {
|
||||
return { error: loc('en', 'apiError', 'liveVideo') };
|
||||
return { error: loc(obj.lang, 'ErrorLiveVideo') };
|
||||
}
|
||||
} else {
|
||||
return { error: loc('en', 'apiError', 'youtubeFetch') };
|
||||
return { error: loc(obj.lang, 'ErrorCantConnectToServiceAPI') };
|
||||
}
|
||||
} catch (e) {
|
||||
return { error: loc('en', 'apiError', 'youtubeFetch') };
|
||||
return { error: loc(obj.lang, 'ErrorBadFetch') };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user