1 | import * as Handlebars from 'handlebars';
|
2 |
|
3 | import { IHtmlEngineHelper, IHandlebarsOptions } from './html-engine-helper.interface';
|
4 |
|
5 | import I18nEngine from '../i18n.engine';
|
6 |
|
7 | export class I18nHelper implements IHtmlEngineHelper {
|
8 | public helperFunc(context: any, i18n_key: string) {
|
9 | if (I18nEngine.exists(i18n_key)) {
|
10 | return I18nEngine.translate(i18n_key.toLowerCase());
|
11 | } else {
|
12 | return i18n_key;
|
13 | }
|
14 | }
|
15 | }
|