Answer the question
In order to leave comments, you need to log in
How to work with sails.js?
With coming!
1) How to use translation on the server side in conjunction with angular? I want the angular service to pick up the content already translated by the server. In sails.js, i18n-node is included in the box and it provides a getLocale() method with which you can get the current locale.
You can make a model like
module.exports = {
attributes: {
name : String,
title : {
en : {type: 'string'},
ru : {type: 'string'},
de : {type: 'string'},
}
}
var
loc = req.getLocale();
Main.findOne({name:'header'}).exec(function findOneCB(err, found){
А здесь как то отфильтровать значения с помощью getLocale() ???? Или как запрос написать?
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question