Aamir Hussain
Aamir Hussain

Reputation: 141

How to apply i18n on console message under Aurelia

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

Answers (1)

zewa666
zewa666

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

Related Questions