mirror of
https://github.com/imputnet/cobalt.git
synced 2026-01-18 21:01:18 +00:00
separated web and api, build improvements
wip: - separate web and api servers. - script for building static pages. - building improvements. - async localisation preloading.
This commit is contained in:
@@ -7,16 +7,13 @@ const locPath = './src/localization/languages';
|
||||
let loc = {}
|
||||
let languages = [];
|
||||
|
||||
export function loadLoc() {
|
||||
fs.readdir(locPath, (err, files) => {
|
||||
if (err) return false;
|
||||
files.forEach(file => {
|
||||
loc[file.split('.')[0]] = loadJson(`${locPath}/${file}`);
|
||||
languages.push(file.split('.')[0])
|
||||
});
|
||||
})
|
||||
export async function loadLoc() {
|
||||
const files = await fs.promises.readdir(locPath).catch((e) => { return [] });
|
||||
files.forEach(file => {
|
||||
loc[file.split('.')[0]] = loadJson(`${locPath}/${file}`);
|
||||
languages.push(file.split('.')[0])
|
||||
});
|
||||
}
|
||||
loadLoc();
|
||||
|
||||
export function replaceBase(s) {
|
||||
return s.replace(/\n/g, '<br/>').replace(/{saveToGalleryShortcut}/g, links.saveToGalleryShortcut).replace(/{appName}/g, appName).replace(/{repo}/g, repo).replace(/\*;/g, "•");
|
||||
|
||||
Reference in New Issue
Block a user