diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-06 14:23:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-06 16:48:40 +0200 |
commit | e945b184a0f29b47c33bbd05578f3493ca9c8e6c (patch) | |
tree | 46c821006d170e6e28658d978e313761adfaf55a /server/controllers | |
parent | 550a562ceca45ea78d6f7054024c8d3a6b89c30c (diff) | |
download | PeerTube-e945b184a0f29b47c33bbd05578f3493ca9c8e6c.tar.gz PeerTube-e945b184a0f29b47c33bbd05578f3493ca9c8e6c.tar.zst PeerTube-e945b184a0f29b47c33bbd05578f3493ca9c8e6c.zip |
Localize player
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/client.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 4b37b5fa6..b153f6086 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -47,6 +47,14 @@ for (const staticClientFile of staticClientFiles) { | |||
47 | clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) | 47 | clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) |
48 | clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE })) | 48 | clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE })) |
49 | 49 | ||
50 | clientsRouter.use('/client/locales/:locale/:file.json', function (req, res) { | ||
51 | if (req.params.locale === 'fr' && req.params.file === 'player') { | ||
52 | return res.sendFile(join(__dirname, '../../../client/dist/locale/player_fr.json')) | ||
53 | } | ||
54 | |||
55 | return res.sendStatus(404) | ||
56 | }) | ||
57 | |||
50 | // 404 for static files not found | 58 | // 404 for static files not found |
51 | clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => { | 59 | clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => { |
52 | res.sendStatus(404) | 60 | res.sendStatus(404) |