mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-27 15:05:38 -04:00
[admin][bug] fix stats directory
This commit is contained in:
parent
d34fe58acb
commit
dcc418bc98
@ -9,7 +9,7 @@ const util = require('util');
|
|||||||
|
|
||||||
async function calculate() {
|
async function calculate() {
|
||||||
const db = await dbConnection();
|
const db = await dbConnection();
|
||||||
const stats = await calculateStats(db, buildLocaleList(null, true));
|
const stats = await calculateStats(db, buildLocaleList(null, true), __dirname + '/..');
|
||||||
await db.close();
|
await db.close();
|
||||||
|
|
||||||
console.log(util.inspect(stats, {showHidden: false, depth: null, colors: true}))
|
console.log(util.inspect(stats, {showHidden: false, depth: null, colors: true}))
|
||||||
|
@ -110,7 +110,7 @@ const checkHeartbeat = async () => {
|
|||||||
return heartbeat;
|
return heartbeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.calculateStats = async (db, allLocales) => {
|
module.exports.calculateStats = async (db, allLocales, projectDir) => {
|
||||||
const id = ulid();
|
const id = ulid();
|
||||||
|
|
||||||
const heartbeat = await checkHeartbeat();
|
const heartbeat = await checkHeartbeat();
|
||||||
@ -137,7 +137,7 @@ module.exports.calculateStats = async (db, allLocales) => {
|
|||||||
for (let locale in allLocales) {
|
for (let locale in allLocales) {
|
||||||
if (!allLocales.hasOwnProperty(locale)) { continue; }
|
if (!allLocales.hasOwnProperty(locale)) { continue; }
|
||||||
|
|
||||||
const translations = new Suml().parse(fs.readFileSync(`./locale/${locale}/translations.suml`).toString());
|
const translations = new Suml().parse(fs.readFileSync(`${projectDir}/locale/${locale}/translations.suml`).toString());
|
||||||
const missingTranslations = expectedTranslations.filter(key => deepGet(translations, key) === undefined).length;
|
const missingTranslations = expectedTranslations.filter(key => deepGet(translations, key) === undefined).length;
|
||||||
|
|
||||||
stats.push({
|
stats.push({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user