mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-27 20:37:32 -07:00
Rework custom
behaviour
This commit is contained in:
parent
1acb89c807
commit
b296e2766f
5 changed files with 3 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -52,7 +52,6 @@ api-docs.json
|
||||||
ormconfig.json
|
ormconfig.json
|
||||||
/custom
|
/custom
|
||||||
packages/backend/assets/instance.css
|
packages/backend/assets/instance.css
|
||||||
/locales/custom
|
|
||||||
|
|
||||||
# blender backups
|
# blender backups
|
||||||
*.blend1
|
*.blend1
|
||||||
|
|
0
custom/locales/.gitkeep
Normal file
0
custom/locales/.gitkeep
Normal file
|
@ -16,7 +16,7 @@ gulp.task('copy:backend:views', () =>
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('copy:backend:custom', () =>
|
gulp.task('copy:backend:custom', () =>
|
||||||
gulp.src('./custom/*').pipe(gulp.dest('./packages/backend/assets/'))
|
gulp.src('./custom/assets/*').pipe(gulp.dest('./packages/backend/assets/'))
|
||||||
);
|
);
|
||||||
|
|
||||||
gulp.task('copy:client:fonts', () =>
|
gulp.task('copy:client:fonts', () =>
|
||||||
|
|
|
@ -23,7 +23,7 @@ fs.readdirSync(__dirname).forEach((file) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
fs.readdirSync(__dirname + '/custom').forEach((file) => {
|
fs.readdirSync(__dirname + '/../custom/locales').forEach((file) => {
|
||||||
if (file.includes('.yml')){
|
if (file.includes('.yml')){
|
||||||
file = file.slice(0, file.indexOf('.'))
|
file = file.slice(0, file.indexOf('.'))
|
||||||
languages_custom.push(file);
|
languages_custom.push(file);
|
||||||
|
@ -40,7 +40,7 @@ const primaries = {
|
||||||
const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), '');
|
const clean = (text) => text.replace(new RegExp(String.fromCodePoint(0x08), 'g'), '');
|
||||||
|
|
||||||
const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/${c}.yml`, 'utf-8'))) || {}, a), {});
|
const locales = languages.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/${c}.yml`, 'utf-8'))) || {}, a), {});
|
||||||
const locales_custom = languages_custom.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/custom/${c}.yml`, 'utf-8'))) || {}, a), {});
|
const locales_custom = languages_custom.reduce((a, c) => (a[c] = yaml.load(clean(fs.readFileSync(`${__dirname}/../custom/locales/${c}.yml`, 'utf-8'))) || {}, a), {});
|
||||||
Object.assign(locales, locales_custom)
|
Object.assign(locales, locales_custom)
|
||||||
|
|
||||||
module.exports = Object.entries(locales)
|
module.exports = Object.entries(locales)
|
||||||
|
|
Loading…
Reference in a new issue