mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
[PM-6769] [SM-1158] Fix Translation pipe issues on main (#8319)
* Require init in i18n service. this is needed to load translations and set translation locale * No longer need to cast i18n * Expose user preferred locale in i18nService This is for correctly displaying `default` when no locale has been set in preferences components. The `locale$` observable should always resolve to the currently locale currently being translated to.
This commit is contained in:
@@ -3,6 +3,7 @@ import { Observable } from "rxjs";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
|
||||
export class I18nMockService implements I18nService {
|
||||
userSetLocale$: Observable<string | undefined>;
|
||||
locale$: Observable<string>;
|
||||
supportedTranslationLocales: string[];
|
||||
translationLocale: string;
|
||||
@@ -38,4 +39,8 @@ export class I18nMockService implements I18nService {
|
||||
async setLocale(locale: string): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
init(): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user