aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/i18n
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-01-03 17:13:11 +0100
committerChocobozzz <me@florianbigard.com>2022-01-06 08:26:14 +0100
commitf8360396ffabd2f95e9ece9c5755173bae0114b6 (patch)
tree83467f70bb5d5c2faa61c45e1d87b538c6c8fe5e /scripts/i18n
parentcea093bca5b9d311b5c1d0539d53e965c901015b (diff)
downloadPeerTube-f8360396ffabd2f95e9ece9c5755173bae0114b6.tar.gz
PeerTube-f8360396ffabd2f95e9ece9c5755173bae0114b6.tar.zst
PeerTube-f8360396ffabd2f95e9ece9c5755173bae0114b6.zip
Stop using tsconfig register
Prefer to replace paths at compile time
Diffstat (limited to 'scripts/i18n')
-rwxr-xr-xscripts/i18n/create-custom-files.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/i18n/create-custom-files.ts b/scripts/i18n/create-custom-files.ts
index d9328b125..7556866e6 100755
--- a/scripts/i18n/create-custom-files.ts
+++ b/scripts/i18n/create-custom-files.ts
@@ -1,9 +1,7 @@
1import { registerTSPaths } from '../../server/helpers/register-ts-paths'
2registerTSPaths()
3
4import { writeJSON } from 'fs-extra' 1import { writeJSON } from 'fs-extra'
5import { values } from 'lodash' 2import { values } from 'lodash'
6import { join } from 'path' 3import { join } from 'path'
4import { root } from '@shared/core-utils'
7import { 5import {
8 buildLanguages, 6 buildLanguages,
9 VIDEO_CATEGORIES, 7 VIDEO_CATEGORIES,
@@ -16,7 +14,7 @@ import {
16} from '../../server/initializers/constants' 14} from '../../server/initializers/constants'
17import { I18N_LOCALES } from '../../shared/core-utils/i18n' 15import { I18N_LOCALES } from '../../shared/core-utils/i18n'
18 16
19const videojs = require(join(__dirname, '../../../client/src/locale/videojs.en-US.json')) 17const videojs = require(join(root(), 'client', 'src', 'locale', 'videojs.en-US.json'))
20const playerKeys = { 18const playerKeys = {
21 'Quality': 'Quality', 19 'Quality': 'Quality',
22 'Auto': 'Auto', 20 'Auto': 'Auto',
@@ -100,7 +98,7 @@ writeAll().catch(err => {
100}) 98})
101 99
102async function writeAll () { 100async function writeAll () {
103 const localePath = join(__dirname, '../../../client/src/locale') 101 const localePath = join(root(), 'client', 'src', 'locale')
104 102
105 await writeJSON(join(localePath, 'player.en-US.json'), playerKeys, { spaces: 4 }) 103 await writeJSON(join(localePath, 'player.en-US.json'), playerKeys, { spaces: 4 })
106 await writeJSON(join(localePath, 'server.en-US.json'), serverKeys, { spaces: 4 }) 104 await writeJSON(join(localePath, 'server.en-US.json'), serverKeys, { spaces: 4 })