Sails js - Locales
up vote
0
down vote
favorite
I've created a custom service using sails js,which supports Internationalization.The translation json files are located in config/locales directory.How will I use these json files on client side javascript to support translations for the texts on client side javascript code.
config/locales/de.json
{
"": "Einen schoenen Tag noch!",
"at": "um",
"In": "In",
"ago": "Vor"
}
and the texts that that must be translated in the javascript file as
function error()
{
var msg = "text to be translated";
openMsgDialog(msg, true);
return false;
}
javascript sails.js
add a comment |
up vote
0
down vote
favorite
I've created a custom service using sails js,which supports Internationalization.The translation json files are located in config/locales directory.How will I use these json files on client side javascript to support translations for the texts on client side javascript code.
config/locales/de.json
{
"": "Einen schoenen Tag noch!",
"at": "um",
"In": "In",
"ago": "Vor"
}
and the texts that that must be translated in the javascript file as
function error()
{
var msg = "text to be translated";
openMsgDialog(msg, true);
return false;
}
javascript sails.js
Have you checked i18n-node ?
– William Chong
Nov 22 at 10:08
yeah,but its not working on the client side js. Any other alternative?
– Pooja Bhonagiri
Nov 22 at 10:35
i18next or any otheri18n-${your_framework}libraries, depends on what you are currently using?
– William Chong
Nov 22 at 10:37
I'm currently using light-weighti18n-node-2, which is built-in support by sails.js
– Pooja Bhonagiri
Nov 22 at 10:42
sails suggests you to use another library for client so maybe just pick another one you like that can load those locale config?
– William Chong
Nov 22 at 10:46
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've created a custom service using sails js,which supports Internationalization.The translation json files are located in config/locales directory.How will I use these json files on client side javascript to support translations for the texts on client side javascript code.
config/locales/de.json
{
"": "Einen schoenen Tag noch!",
"at": "um",
"In": "In",
"ago": "Vor"
}
and the texts that that must be translated in the javascript file as
function error()
{
var msg = "text to be translated";
openMsgDialog(msg, true);
return false;
}
javascript sails.js
I've created a custom service using sails js,which supports Internationalization.The translation json files are located in config/locales directory.How will I use these json files on client side javascript to support translations for the texts on client side javascript code.
config/locales/de.json
{
"": "Einen schoenen Tag noch!",
"at": "um",
"In": "In",
"ago": "Vor"
}
and the texts that that must be translated in the javascript file as
function error()
{
var msg = "text to be translated";
openMsgDialog(msg, true);
return false;
}
javascript sails.js
javascript sails.js
asked Nov 22 at 10:00
Pooja Bhonagiri
143
143
Have you checked i18n-node ?
– William Chong
Nov 22 at 10:08
yeah,but its not working on the client side js. Any other alternative?
– Pooja Bhonagiri
Nov 22 at 10:35
i18next or any otheri18n-${your_framework}libraries, depends on what you are currently using?
– William Chong
Nov 22 at 10:37
I'm currently using light-weighti18n-node-2, which is built-in support by sails.js
– Pooja Bhonagiri
Nov 22 at 10:42
sails suggests you to use another library for client so maybe just pick another one you like that can load those locale config?
– William Chong
Nov 22 at 10:46
add a comment |
Have you checked i18n-node ?
– William Chong
Nov 22 at 10:08
yeah,but its not working on the client side js. Any other alternative?
– Pooja Bhonagiri
Nov 22 at 10:35
i18next or any otheri18n-${your_framework}libraries, depends on what you are currently using?
– William Chong
Nov 22 at 10:37
I'm currently using light-weighti18n-node-2, which is built-in support by sails.js
– Pooja Bhonagiri
Nov 22 at 10:42
sails suggests you to use another library for client so maybe just pick another one you like that can load those locale config?
– William Chong
Nov 22 at 10:46
Have you checked i18n-node ?
– William Chong
Nov 22 at 10:08
Have you checked i18n-node ?
– William Chong
Nov 22 at 10:08
yeah,but its not working on the client side js. Any other alternative?
– Pooja Bhonagiri
Nov 22 at 10:35
yeah,but its not working on the client side js. Any other alternative?
– Pooja Bhonagiri
Nov 22 at 10:35
i18next or any other
i18n-${your_framework} libraries, depends on what you are currently using?– William Chong
Nov 22 at 10:37
i18next or any other
i18n-${your_framework} libraries, depends on what you are currently using?– William Chong
Nov 22 at 10:37
I'm currently using light-weight
i18n-node-2 , which is built-in support by sails.js– Pooja Bhonagiri
Nov 22 at 10:42
I'm currently using light-weight
i18n-node-2 , which is built-in support by sails.js– Pooja Bhonagiri
Nov 22 at 10:42
sails suggests you to use another library for client so maybe just pick another one you like that can load those locale config?
– William Chong
Nov 22 at 10:46
sails suggests you to use another library for client so maybe just pick another one you like that can load those locale config?
– William Chong
Nov 22 at 10:46
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Sails.js only covers the server i18n, and it suggests you to use another library for client.
You can check if i18next suits your need.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Sails.js only covers the server i18n, and it suggests you to use another library for client.
You can check if i18next suits your need.
add a comment |
up vote
1
down vote
Sails.js only covers the server i18n, and it suggests you to use another library for client.
You can check if i18next suits your need.
add a comment |
up vote
1
down vote
up vote
1
down vote
Sails.js only covers the server i18n, and it suggests you to use another library for client.
You can check if i18next suits your need.
Sails.js only covers the server i18n, and it suggests you to use another library for client.
You can check if i18next suits your need.
answered Nov 22 at 10:55
William Chong
826416
826416
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53428336%2fsails-js-locales%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you checked i18n-node ?
– William Chong
Nov 22 at 10:08
yeah,but its not working on the client side js. Any other alternative?
– Pooja Bhonagiri
Nov 22 at 10:35
i18next or any other
i18n-${your_framework}libraries, depends on what you are currently using?– William Chong
Nov 22 at 10:37
I'm currently using light-weight
i18n-node-2, which is built-in support by sails.js– Pooja Bhonagiri
Nov 22 at 10:42
sails suggests you to use another library for client so maybe just pick another one you like that can load those locale config?
– William Chong
Nov 22 at 10:46