diff options
Diffstat (limited to 'server/controllers/client.ts')
-rw-r--r-- | server/controllers/client.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index b153f6086..ec78a4bbc 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -48,8 +48,11 @@ 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) { | 50 | clientsRouter.use('/client/locales/:locale/:file.json', function (req, res) { |
51 | if (req.params.locale === 'fr' && req.params.file === 'player') { | 51 | const locale = req.params.locale |
52 | return res.sendFile(join(__dirname, '../../../client/dist/locale/player_fr.json')) | 52 | const file = req.params.file |
53 | |||
54 | if (is18nLocale(locale) && [ 'player', 'server' ].indexOf(file) !== -1) { | ||
55 | return res.sendFile(join(__dirname, `../../../client/dist/locale/${file}_${locale}.json`)) | ||
53 | } | 56 | } |
54 | 57 | ||
55 | return res.sendStatus(404) | 58 | return res.sendStatus(404) |