M
M
monochromer2018-07-11 17:09:39
Internationalization and localization
monochromer, 2018-07-11 17:09:39

How to do routing for localization on Node.js and Express.js?

All health!
The essence of the problem is as follows.
The site uses some default language, such as English. To switch to another language, for example, Russian, the paths should be: http://site.com/ru/some-path. How to configure routing to render the same templates with different languages ​​for routes:
site.com/some-path
site.com/ru/some-path
Added a prototype of what I want to do
https://glitch.com/edit/#!/ i18n-node-express
Is this good practice or could it be better?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question