Multilanguage express app

后端 未结 3 1619
孤城傲影
孤城傲影 2021-01-31 04:15

I wonder what would be the best way to implement multiple versions / languages of the same content in the same layout in express.

Should I just do this?

         


        
3条回答
  •  清酒与你
    2021-01-31 04:59

    i thought that we can define json objects in lang folder like , en.js , fr.js and this json files contains key value pairs than render to template according to user's language setting , lang settings can be into database.

    And we can save this fr.js or anything else into res.locals for calling every template .

    Is this suitable?

提交回复
热议问题