Building succeeds
This commit is contained in:
@ -7,14 +7,14 @@ const path = require('path');
|
||||
const rimraf = require('rimraf');
|
||||
const mkdirp = require('mkdirp');
|
||||
|
||||
const localesJsonPath = path.join(__dirname, '../../app/javascript/gabsocial/locales');
|
||||
const localesJsonPath = path.join(__dirname, '../app/gabsocial/locales');
|
||||
const locales = fs.readdirSync(localesJsonPath).filter(filename => {
|
||||
return /\.json$/.test(filename) &&
|
||||
!/defaultMessages/.test(filename) &&
|
||||
!/whitelist/.test(filename);
|
||||
}).map(filename => filename.replace(/\.json$/, ''));
|
||||
|
||||
const outPath = path.join(__dirname, '../../tmp/packs');
|
||||
const outPath = path.join(__dirname, '..', 'tmp', 'packs');
|
||||
|
||||
rimraf.sync(outPath);
|
||||
mkdirp.sync(outPath);
|
||||
@ -28,7 +28,7 @@ locales.forEach(locale => {
|
||||
// first try react-intl
|
||||
`../../node_modules/react-intl/locale-data/${baseLocale}.js`,
|
||||
// then check locales/locale-data
|
||||
`../../app/javascript/gabsocial/locales/locale-data/${baseLocale}.js`,
|
||||
`../../app/gabsocial/locales/locale-data/${baseLocale}.js`,
|
||||
// fall back to English (this is what react-intl does anyway)
|
||||
'../../node_modules/react-intl/locale-data/en.js',
|
||||
].filter(filename => fs.existsSync(path.join(outPath, filename)))
|
||||
@ -38,9 +38,9 @@ locales.forEach(locale => {
|
||||
// locale_${locale}.js
|
||||
// automatically generated by generateLocalePacks.js
|
||||
//
|
||||
import messages from '../../app/javascript/gabsocial/locales/${locale}.json';
|
||||
import messages from '../../app/gabsocial/locales/${locale}.json';
|
||||
import localeData from ${JSON.stringify(localeDataPath)};
|
||||
import { setLocale } from '../../app/javascript/gabsocial/locales';
|
||||
import { setLocale } from '../../app/gabsocial/locales';
|
||||
setLocale({messages, localeData});
|
||||
`;
|
||||
fs.writeFileSync(localePath, localeContent, 'utf8');
|
||||
@ -48,5 +48,3 @@ setLocale({messages, localeData});
|
||||
});
|
||||
|
||||
module.exports = outPaths;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user