mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-19 22:19:52 +00:00
Now that we have moved to Transifex, auto updation of translation strings is not required. We would only need to update the resource file (en.json) and push it to Transifex and pulling the rest <lang>.json
17 lines
483 B
TypeScript
17 lines
483 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'});
|
|
}
|