- Select Setup Flow
+ {{ 'Select Setup Flow' | i18n }}
- Start Fresh
-
Set up a brand new server
+ {{ 'Start Fresh' | i18n }}
+
{{ 'Set up a brand new server' | i18n }}
- Restore from Backup
-
Restore StartOS data from an encrypted backup
+ {{ 'Restore from Backup' | i18n }}
+
+ {{ 'Restore StartOS data from an encrypted backup' | i18n }}
+
- Transfer
+ {{ 'Transfer' | i18n }}
- Transfer data from an existing StartOS data drive
+ {{ 'Transfer data from an existing StartOS data drive' | i18n }}
@@ -46,6 +49,7 @@ import { StateService } from '../services/state.service'
TuiCell,
TuiTitle,
TuiAvatar,
+ i18nPipe,
],
})
export default class HomePage {
diff --git a/web/projects/setup-wizard/src/app/pages/keyboard.page.ts b/web/projects/setup-wizard/src/app/pages/keyboard.page.ts
index 0bdb9cdfe..7ed0fda2c 100644
--- a/web/projects/setup-wizard/src/app/pages/keyboard.page.ts
+++ b/web/projects/setup-wizard/src/app/pages/keyboard.page.ts
@@ -1,6 +1,7 @@
import { Component, inject } from '@angular/core'
import { Router } from '@angular/router'
import { FormsModule } from '@angular/forms'
+import { i18nPipe } from '@start9labs/shared'
import { TUI_IS_MOBILE } from '@taiga-ui/cdk'
import { TuiButton, TuiTextfield, TuiTitle } from '@taiga-ui/core'
import { TuiChevron, TuiDataListWrapper, TuiSelect } from '@taiga-ui/kit'
@@ -12,14 +13,14 @@ import { Keyboard, getKeyboardsForLanguage } from '../utils/languages'
template: `
- Select Keyboard Layout
+ {{ 'Select Keyboard Layout' | i18n }}
- Keyboard
+ {{ 'Keyboard' | i18n }}
@if (mobile) {
} @else {
@@ -36,7 +37,7 @@ import { Keyboard, getKeyboardsForLanguage } from '../utils/languages'
- Continue
+ {{ 'Continue' | i18n }}
@@ -65,6 +66,7 @@ import { Keyboard, getKeyboardsForLanguage } from '../utils/languages'
TuiDataListWrapper,
TuiHeader,
TuiTitle,
+ i18nPipe,
],
})
export default class KeyboardPage {
diff --git a/web/projects/setup-wizard/src/app/pages/language.page.ts b/web/projects/setup-wizard/src/app/pages/language.page.ts
index af5193d9d..d7a5af24a 100644
--- a/web/projects/setup-wizard/src/app/pages/language.page.ts
+++ b/web/projects/setup-wizard/src/app/pages/language.page.ts
@@ -1,6 +1,7 @@
import { Component, inject } from '@angular/core'
import { Router } from '@angular/router'
import { FormsModule } from '@angular/forms'
+import { i18nPipe, i18nService } from '@start9labs/shared'
import { TUI_IS_MOBILE } from '@taiga-ui/cdk'
import { TuiButton, TuiTextfield, TuiTitle } from '@taiga-ui/core'
import { TuiChevron, TuiDataListWrapper, TuiSelect } from '@taiga-ui/kit'
@@ -20,22 +21,30 @@ import {
- Welcome to StartOS
+ {{ 'Welcome to' | i18n }} StartOS
- Select your language
+ {{ 'Select your language' | i18n }}
-
- Language
+ {{ 'Language' | i18n }}
@if (mobile) {
-
+
} @else {
-
+
}
@if (!mobile) {
+ @let lang = asLanguage(item);
- {{ item.nativeName }}
- @if (item.name !== item.nativeName) {
- {{ item.name }}
- }
+ {{ lang.nativeName }}
+ {{ lang.tuiName | i18n }}
- Continue
+ {{ 'Continue' | i18n }}
@@ -90,29 +98,43 @@ import {
TuiDataListWrapper,
TuiHeader,
TuiTitle,
+ i18nPipe,
],
})
export default class LanguagePage {
private readonly router = inject(Router)
private readonly stateService = inject(StateService)
+ private readonly i18nService = inject(i18nService)
protected readonly mobile = inject(TUI_IS_MOBILE)
readonly languages = LANGUAGES
+
selected =
LANGUAGES.find(l => l.code === this.stateService.language) || LANGUAGES[0]
readonly stringify = (lang: Language) => lang.nativeName
+ readonly asLanguage = (item: unknown): Language => item as Language
+
+ constructor() {
+ if (this.selected) {
+ this.i18nService.setLanguage(this.selected.tuiName)
+ }
+ }
+
+ onLanguageChange(language: Language) {
+ if (language) {
+ this.i18nService.setLanguage(language.tuiName)
+ }
+ }
async continue() {
if (this.selected) {
this.stateService.language = this.selected.code
if (this.stateService.kiosk) {
- // Check if we need keyboard selection
if (needsKeyboardSelection(this.selected.code)) {
await this.router.navigate(['/keyboard'])
} else {
- // Auto-select the only keyboard option
this.stateService.keyboard = getDefaultKeyboard(
this.selected.code,
).code
diff --git a/web/projects/setup-wizard/src/app/pages/loading.page.ts b/web/projects/setup-wizard/src/app/pages/loading.page.ts
index a11d152b9..3f971c0e4 100644
--- a/web/projects/setup-wizard/src/app/pages/loading.page.ts
+++ b/web/projects/setup-wizard/src/app/pages/loading.page.ts
@@ -10,7 +10,7 @@ import {
DialogService,
formatProgress,
getErrorMessage,
- i18nKey,
+ i18nPipe,
InitializingComponent,
LoadingService,
} from '@start9labs/shared'
@@ -33,9 +33,11 @@ import { StateService } from '../services/state.service'
template: `
@if (error(); as err) {
- Error initializing server
+ {{ 'Error initializing server' | i18n }}
{{ err }}
- Restart server
+
+ {{ 'Restart server' | i18n }}
+
} @else {
@@ -57,7 +59,7 @@ import { StateService } from '../services/state.service'
--tui-background-neutral-1: rgba(0, 0, 0, 0.1);
}
`,
- imports: [InitializingComponent, TuiButton],
+ imports: [InitializingComponent, TuiButton, i18nPipe],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export default class LoadingPage {
@@ -65,6 +67,7 @@ export default class LoadingPage {
private readonly loader = inject(LoadingService)
private readonly dialog = inject(DialogService)
private readonly router = inject(Router)
+ private readonly i18n = inject(i18nPipe)
readonly type = inject(StateService).setupType
readonly progress = toSignal(
@@ -117,7 +120,7 @@ export default class LoadingPage {
try {
await this.api.restart()
this.dialog
- .openAlert('Wait 1-2 minutes and refresh the page' as i18nKey, {
+ .openAlert('Wait 1-2 minutes and refresh the page', {
label: 'Server is restarting',
})
.subscribe()
diff --git a/web/projects/setup-wizard/src/app/pages/password.page.ts b/web/projects/setup-wizard/src/app/pages/password.page.ts
index 4a721ae4c..adef97f3a 100644
--- a/web/projects/setup-wizard/src/app/pages/password.page.ts
+++ b/web/projects/setup-wizard/src/app/pages/password.page.ts
@@ -8,7 +8,7 @@ import {
ReactiveFormsModule,
Validators,
} from '@angular/forms'
-import { ErrorService, i18nKey, LoadingService } from '@start9labs/shared'
+import { ErrorService, i18nPipe, LoadingService } from '@start9labs/shared'
import { TuiAutoFocus, TuiMapperPipe, TuiValidator } from '@taiga-ui/cdk'
import {
TuiButton,
@@ -31,13 +31,15 @@ import { StateService } from '../services/state.service'
{{
- isRequired ? 'Set Master Password' : 'Set New Password (Optional)'
+ isRequired
+ ? ('Set Master Password' | i18n)
+ : ('Set New Password (Optional)' | i18n)
}}
{{
isRequired
- ? 'Make it good. Write it down.'
- : 'Skip to keep your existing password.'
+ ? ('Make it good. Write it down.' | i18n)
+ : ('Skip to keep your existing password.' | i18n)
}}
@@ -46,7 +48,9 @@ import { StateService } from '../services/state.service'
} @empty {
-