From e945b184a0f29b47c33bbd05578f3493ca9c8e6c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 6 Jun 2018 14:23:40 +0200 Subject: Localize player --- server/controllers/client.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'server') 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) { clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE })) clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE })) +clientsRouter.use('/client/locales/:locale/:file.json', function (req, res) { + if (req.params.locale === 'fr' && req.params.file === 'player') { + return res.sendFile(join(__dirname, '../../../client/dist/locale/player_fr.json')) + } + + return res.sendStatus(404) +}) + // 404 for static files not found clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => { res.sendStatus(404) -- cgit v1.2.3