Reputation: 141
I am working under Aurelia Framework.I want to apply i18N on console messages . I am using two languages "English" and "French"
Console.log("Hello World");
How i can print this message in french if user change language mode.
Upvotes: 1
Views: 252
Reputation: 2603
The docs for the plugin do contain exactly that example:
import {I18N} from 'aurelia-i18n';
export class MyDemoVM {
static inject = [I18N];
constructor(i18n) {
this.i18n = i18n;
console.log(this.i18n.tr('mykey'));
}
...
}
Upvotes: 2