Files
zulip-desktop/app/renderer/js/utils/translation-util.ts
Anders Kaseorg 8d66f05924 xo: Sort imports with import/order.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-23 23:06:41 -07:00

19 lines
485 B
TypeScript

import path from 'path';
import i18n from 'i18n';
import * as ConfigUtil from './config-util';
i18n.configure({
directory: path.join(__dirname, '../../../translations/'),
updateFiles: false
});
/* Fetches the current appLocale from settings.json */
const appLocale = ConfigUtil.getConfigItem('appLanguage');
/* If no locale present in the json, en is set default */
export function __(phrase: string): string {
return i18n.__({phrase, locale: appLocale ? appLocale : 'en'});
}