fix(i18n): route dirty-guard and html-editor strings through TranslateService
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
window.confirm/window.prompt calls in projectEditorDirtyGuard and MarketplaceHtmlEditorComponent, and the hardcoded Preview/Code toggle label in its template, bypassed the app's translation pipeline. Add builder.confirmLeaveUnsaved, promptLinkUrl, promptImageUrl, htmlEditorCode and htmlEditorPreview keys (en/ru/hy), resolve them via TranslateService.t() before passing to confirm/prompt, and use TranslatePipe for the toggle button label.
This commit is contained in:
@@ -2,11 +2,13 @@ import { inject } from '@angular/core';
|
||||
import { CanDeactivateFn } from '@angular/router';
|
||||
import { ProjectEditorFacade } from '../facade/project-editor.facade';
|
||||
import { ProjectEditorPageComponent } from '../pages/project-editor-page.component';
|
||||
import { TranslateService } from '../../../i18n/translate.service';
|
||||
|
||||
export const projectEditorDirtyGuard: CanDeactivateFn<ProjectEditorPageComponent> = () => {
|
||||
const facade = inject(ProjectEditorFacade);
|
||||
if (!facade.dirty()) {
|
||||
return true;
|
||||
}
|
||||
return window.confirm('You have unsaved changes. Leave anyway?');
|
||||
const translate = inject(TranslateService);
|
||||
return window.confirm(translate.t('builder.confirmLeaveUnsaved'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user