Skip to content

Commit b6b147d

Browse files
committed
Update translations generator
1 parent 5c30d5f commit b6b147d

File tree

2 files changed

+66
-7
lines changed

2 files changed

+66
-7
lines changed

package-lock.json

Lines changed: 59 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/server/translations_generator/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import { google } from 'googleapis'
22
import { /* flatten, */ unflatten } from 'flat'
33
import fs from 'fs-extra'
4-
import { portalConfig } from '../../../src/client/configs/PortalConfig.json'
54
// import localeEN from '../../client/translations/sampo/localeEN'
65
import dotenv from 'dotenv'
7-
86
dotenv.config()
97

10-
const { readTranslationsFromGoogleSheets } = portalConfig
8+
if (!process.env.SHEETS_API_SHEET_ID) {
9+
throw new Error('env variable SHEETS_API_SHEET_ID missing')
10+
}
11+
12+
const portalConfig = JSON.parse(fs.readFileSync('src/configs/portalConfig.json'))
13+
14+
const { readTranslationsFromGoogleSheets } = portalConfig.localeConfig
1115

1216
// console.log(`spreadsheetId: ${process.env.SHEETS_API_SHEET_ID}`)
1317
// console.log(`credentials: ${process.env.GOOGLE_APPLICATION_CREDENTIALS}`)

0 commit comments

Comments
 (0)