A new library has been added as a dependency, so npm install (or npm update?) will be required.
To test, in your code where ever authPass is available:
var string = req/thisHook.authPass.t('My string');
string should = 'My string'
The language defaults to en, so check in /configurations/locals for a file en.js
This should contain something like {'My string' : 'My string'}
To test translating from one language to another, create a de.js file in /locals and add:
{
"My string": "German string"
}
Then in your function do:
var ap = thisHook.authPass;
// Change the language for this user. This would typically be done in hook_auth_authpass
ap.setLocale('de');
var string = ap.t('My string');
A new library has been added as a dependency, so npm install (or npm update?) will be required.
To test, in your code where ever authPass is available:
string should = 'My string'
The language defaults to en, so check in /configurations/locals for a file en.js
This should contain something like {'My string' : 'My string'}
To test translating from one language to another, create a de.js file in /locals and add:
Then in your function do:
string should now = 'German string'
For more info on how to do more complicated translations, consult https://github.com/mashpie/i18n-node