mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-18 06:09:58 +00:00
137184d469
- added download popup to solve the issue with downloads on ios - merged big and small popups into one - made buttons in donation menu act like buttons - began to clean up localisation - added ability to embed repo url into localisation strings - moved ffmpeg args to config for more flexibility (and hopefully future changes) - removed error response in stream that could result in a crash - removed notice for ios users from about cause it's no longer relevant - made error popup look and act like the rest - a tiny bit of clean up - ill do better changelog tomorrow i think
23 lines
677 B
JavaScript
23 lines
677 B
JavaScript
import { supportedLanguages, appName, repo } from "../config.js";
|
|
import loadJson from "./load-json.js";
|
|
|
|
export default function(lang, cat, string, replacement) {
|
|
if (!supportedLanguages.includes(lang)) {
|
|
lang = 'en'
|
|
}
|
|
try {
|
|
let str = loadJson(`./strings/${lang}/${cat}.json`);
|
|
if (str && str[string]) {
|
|
let s = str[string].replace(/\n/g, '<br/>').replace(/{appName}/g, appName).replace(/{repo}/g, repo)
|
|
if (replacement) {
|
|
s = s.replace(/{s}/g, replacement)
|
|
}
|
|
return s + ' '
|
|
} else {
|
|
return string
|
|
}
|
|
} catch (e) {
|
|
return string
|
|
}
|
|
}
|