diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-03 17:13:11 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-06 08:26:14 +0100 |
commit | f8360396ffabd2f95e9ece9c5755173bae0114b6 (patch) | |
tree | 83467f70bb5d5c2faa61c45e1d87b538c6c8fe5e /scripts/i18n | |
parent | cea093bca5b9d311b5c1d0539d53e965c901015b (diff) | |
download | PeerTube-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-x | scripts/i18n/create-custom-files.ts | 8 |
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 @@ | |||
1 | import { registerTSPaths } from '../../server/helpers/register-ts-paths' | ||
2 | registerTSPaths() | ||
3 | |||
4 | import { writeJSON } from 'fs-extra' | 1 | import { writeJSON } from 'fs-extra' |
5 | import { values } from 'lodash' | 2 | import { values } from 'lodash' |
6 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { root } from '@shared/core-utils' | ||
7 | import { | 5 | import { |
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' |
17 | import { I18N_LOCALES } from '../../shared/core-utils/i18n' | 15 | import { I18N_LOCALES } from '../../shared/core-utils/i18n' |
18 | 16 | ||
19 | const videojs = require(join(__dirname, '../../../client/src/locale/videojs.en-US.json')) | 17 | const videojs = require(join(root(), 'client', 'src', 'locale', 'videojs.en-US.json')) |
20 | const playerKeys = { | 18 | const playerKeys = { |
21 | 'Quality': 'Quality', | 19 | 'Quality': 'Quality', |
22 | 'Auto': 'Auto', | 20 | 'Auto': 'Auto', |
@@ -100,7 +98,7 @@ writeAll().catch(err => { | |||
100 | }) | 98 | }) |
101 | 99 | ||
102 | async function writeAll () { | 100 | async 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 }) |