1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-24 23:37:51 +01:00

23 lines
468 B
JavaScript
Raw Normal View History

import Component from './Component';
/**
* The `Page` component
*
* @abstract
*/
export default class Page extends Component {
page = JSON.parse($('#app').attr('data-page'));
__(key: string, replace: Object = {}) {
let translation = this.page.language[key]
? this.page.language[key]
: key;
Object.keys(replace).forEach((k: string) => {
translation = translation.replace(`:${k}`, replace[k]);
});
return translation;
}
}