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:
19
src/services/i18n.service.ts
Normal file
19
src/services/i18n.service.ts
Normal 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'
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,9 @@ export class NodePlatformUtilsService implements PlatformUtilsService {
|
||||
return Utils.getHostname(uriString);
|
||||
}
|
||||
|
||||
isViewOpen: () => false;
|
||||
isViewOpen() {
|
||||
return false;
|
||||
}
|
||||
|
||||
launchUri(uri: string, options?: any): void { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user