Refactor i18n approach (#2875)

* Refactor i18n approach

* chore: move to shared

* chore: add default

* create DialogService and update LoadingService (#2876)

* complete translation infra for ui project, currently broken

* cleanup and more dictionaries

* chore: fix

---------

Co-authored-by: Matt Hill <MattDHill@users.noreply.github.com>
Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
Alex Inkin
2025-04-17 22:00:59 +07:00
committed by GitHub
parent 47b6509f70
commit 50755d8ba3
175 changed files with 4141 additions and 1831 deletions

View File

@@ -5,7 +5,13 @@ import {
AbstractCategoryService,
FilterPackagesPipe,
} from '@start9labs/marketplace'
import { RELATIVE_URL, WorkspaceConfig } from '@start9labs/shared'
import {
I18N_PROVIDERS,
I18N_STORAGE,
i18nService,
RELATIVE_URL,
WorkspaceConfig,
} from '@start9labs/shared'
import {
TUI_DATE_FORMAT,
TUI_DIALOGS_CLOSE,
@@ -21,8 +27,6 @@ import {
import { tuiTextfieldOptionsProvider } from '@taiga-ui/legacy'
import { PatchDB } from 'patch-db-client'
import { filter, of, pairwise } from 'rxjs'
import { I18N_PROVIDERS } from 'src/app/i18n/i18n.providers'
import { i18nService } from 'src/app/i18n/i18n.service'
import {
PATCH_CACHE,
PatchDbSource,
@@ -100,6 +104,14 @@ export const APP_PROVIDERS: Provider[] = [
),
),
},
{
provide: I18N_STORAGE,
useFactory: () => {
const api = inject(ApiService)
return (language: string) => api.setDbValue(['language'], language)
},
},
]
export function appInitializer(): () => void {