Translation infrastructure

This commit is contained in:
Eugene Pankov
2022-01-08 16:02:56 +01:00
parent 04010b58bb
commit 0814d44207
134 changed files with 8137 additions and 889 deletions

View File

@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'
import { ConfigService, HostWindowService } from 'tabby-core'
import { ConfigService, HostWindowService, TranslateService } from 'tabby-core'
@Injectable({ providedIn: 'root' })
export class WebHostWindow extends HostWindowService {
@@ -7,6 +7,7 @@ export class WebHostWindow extends HostWindowService {
constructor (
config: ConfigService,
translate: TranslateService,
) {
super()
this.windowShown.next()
@@ -15,7 +16,7 @@ export class WebHostWindow extends HostWindowService {
const unloadHandler = (event) => {
if (config.store.web.preventAccidentalTabClosure) {
event.preventDefault()
event.returnValue = 'Are you sure you want to close Tabby? You can disable this prompt in Settings -> Window.'
event.returnValue = translate.instant('Are you sure you want to close Tabby? You can disable this prompt in Settings -> Window.')
} else {
window.removeEventListener('beforeunload', unloadHandler)
}