mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
This reverts commit 5a1940f3f4.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
export abstract class I18nService<TKey = string> {
|
||||
export abstract class I18nService {
|
||||
locale$: Observable<string>;
|
||||
supportedTranslationLocales: string[];
|
||||
translationLocale: string;
|
||||
collator: Intl.Collator;
|
||||
localeNames: Map<string, string>;
|
||||
t: (id: TKey, p1?: string | number, p2?: string | number, p3?: string | number) => string;
|
||||
translate: (id: TKey, p1?: string, p2?: string, p3?: string) => string;
|
||||
t: (id: string, p1?: string | number, p2?: string | number, p3?: string | number) => string;
|
||||
translate: (id: string, p1?: string, p2?: string, p3?: string) => string;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,8 @@ export class PlanResponse extends BaseResponse {
|
||||
product: ProductType;
|
||||
name: string;
|
||||
isAnnual: boolean;
|
||||
nameLocalizationKey: "planNameFree" | "planNameFamilies" | "planNameTeams" | "planNameEnterprise";
|
||||
descriptionLocalizationKey:
|
||||
| "planDescFree"
|
||||
| "planDescFamilies"
|
||||
| "planDescTeams"
|
||||
| "planDescEnterprise";
|
||||
nameLocalizationKey: string;
|
||||
descriptionLocalizationKey: string;
|
||||
canBeUsedByBusiness: boolean;
|
||||
baseSeats: number;
|
||||
baseStorageGb: number;
|
||||
|
||||
@@ -60,7 +60,7 @@ export class BillingSubscriptionItemResponse extends BaseResponse {
|
||||
name: string;
|
||||
amount: number;
|
||||
quantity: number;
|
||||
interval: "month" | "year";
|
||||
interval: string;
|
||||
sponsoredSubscriptionItem: boolean;
|
||||
|
||||
constructor(response: any) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Observable, ReplaySubject } from "rxjs";
|
||||
|
||||
import { I18nService } from "../abstractions/i18n.service";
|
||||
import { I18nService as I18nServiceAbstraction } from "../abstractions/i18n.service";
|
||||
|
||||
export class I18nServiceImplementation<TKey = string> implements I18nService<TKey> {
|
||||
export class I18nService implements I18nServiceAbstraction {
|
||||
private _locale = new ReplaySubject<string>(1);
|
||||
locale$: Observable<string> = this._locale.asObservable();
|
||||
// First locale is the default (English)
|
||||
@@ -118,11 +118,11 @@ export class I18nServiceImplementation<TKey = string> implements I18nService<TKe
|
||||
}
|
||||
}
|
||||
|
||||
t(id: TKey, p1?: string, p2?: string, p3?: string): string {
|
||||
t(id: string, p1?: string, p2?: string, p3?: string): string {
|
||||
return this.translate(id, p1, p2, p3);
|
||||
}
|
||||
|
||||
translate(id: TKey, p1?: string | number, p2?: string | number, p3?: string | number): string {
|
||||
translate(id: string, p1?: string | number, p2?: string | number, p3?: string | number): string {
|
||||
let result: string;
|
||||
// eslint-disable-next-line
|
||||
if (this.localeMessages.hasOwnProperty(id) && this.localeMessages[id]) {
|
||||
Reference in New Issue
Block a user