1
0
mirror of https://github.com/bitwarden/cli synced 2026-01-05 09:43:15 +00:00

main and program are classes

This commit is contained in:
Kyle Spearrin
2018-05-14 11:15:54 -04:00
parent ad2fa7efbb
commit 7f0f4a11f8
7 changed files with 210 additions and 74 deletions

View File

@@ -0,0 +1,19 @@
import * as fs from 'fs';
import * as path from 'path';
import { I18nService as BaseI18nService } from 'jslib/services/i18n.service';
export class I18nService extends BaseI18nService {
constructor(systemLanguage: string, localesDirectory: string) {
super(systemLanguage, localesDirectory, (formattedLocale: string) => {
const filePath = path.join(__dirname, this.localesDirectory + '/' + formattedLocale + '/messages.json');
const localesJson = fs.readFileSync(filePath, 'utf8');
const locales = JSON.parse(localesJson.replace(/^\uFEFF/, '')); // strip the BOM
return Promise.resolve(locales);
});
this.supportedTranslationLocales = [
'en'
];
}
}

View File

@@ -50,7 +50,9 @@ export class NodePlatformUtilsService implements PlatformUtilsService {
return Utils.getHostname(uriString);
}
isViewOpen: () => false;
isViewOpen() {
return false;
}
launchUri(uri: string, options?: any): void { }