Skip to content

Instantly share code, notes, and snippets.

@tigransimonyan
Created August 19, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tigransimonyan/ddf3152000d632016dc98e16ccc9f187 to your computer and use it in GitHub Desktop.
Save tigransimonyan/ddf3152000d632016dc98e16ccc9f187 to your computer and use it in GitHub Desktop.
router.get('/ru', async(request, response, next) => {
const videos = await Video.getIndexVideos();
const response = await Promise.all(videos.map(video => {
return translate(video.video_title, { to: 'ru' }).then(res => {
return Object.assign({}, video, { video_title: res.text });
});
}));
response.render('_LANGS/rus/index', {
section_name: "Home",
videos: response
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment