mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 14:32:04 -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() {
|
||||
const db = await dbConnection();
|
||||
const stats = await calculateStats(db, buildLocaleList(null, true));
|
||||
const stats = await calculateStats(db, buildLocaleList(null, true), __dirname + '/..');
|
||||
await db.close();
|
||||
|
||||
console.log(util.inspect(stats, {showHidden: false, depth: null, colors: true}))
|
||||
|
@ -110,7 +110,7 @@ const checkHeartbeat = async () => {
|
||||
return heartbeat;
|
||||
}
|
||||
|
||||
module.exports.calculateStats = async (db, allLocales) => {
|
||||
module.exports.calculateStats = async (db, allLocales, projectDir) => {
|
||||
const id = ulid();
|
||||
|
||||
const heartbeat = await checkHeartbeat();
|
||||
@ -137,7 +137,7 @@ module.exports.calculateStats = async (db, allLocales) => {
|
||||
for (let locale in allLocales) {
|
||||
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;
|
||||
|
||||
stats.push({
|
||||
|
Loading…
x
Reference in New Issue
Block a user