Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 0 additions & 94 deletions extract-translations.ts

This file was deleted.

39 changes: 0 additions & 39 deletions machine-translation.ts

This file was deleted.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"update:kompakkt:server-openapi": "bun run update-git-dependency.ts -d @kompakkt/server-openapi -o Kompakkt -r Server -b openapi-types",
"e2e": "concurrently \"ng serve --port 1503\" \"wait-on http-get://localhost:1503 && npm run cy:run\" --kill-others --success first",
"e2e-gui": "concurrently \"ng serve --port 1503\" \"wait-on http-get://localhost:1503 && npm run cy:open\" --kill-others --success first",
"extract-translations": "ts-node --skipProject ./extract-translations.ts"
"i18n:verify": "bun run ngx-fluent-cli --fluent-file-dir ./src/assets/i18n"
},
"contributors": [
{
Expand Down Expand Up @@ -52,6 +52,8 @@
"@angular/platform-browser": "22.2.3",
"@angular/platform-browser-dynamic": "22.2.3",
"@angular/router": "22.2.3",
"@apappas1129/ngx-fluent": "^22.0.3",
"@fluent/bundle": "^0.19.1",
"@kompakkt/common": "git+https://github.com/Kompakkt/Common.git#1ff4f862a5464d8cd236755a900f3722202552a9",
"@kompakkt/komponents": "git+https://github.com/Kompakkt/Komponents.git#7d4ad1ec8fa03e09ead55bbf667afea5db97f9f7",
"@kompakkt/plugins": "git+https://github.com/Kompakkt/Plugins.git#4e2c0f4665f01be50104df4417cc08c5bb97bbba",
Expand Down Expand Up @@ -79,6 +81,7 @@
"@types/pluralize": "^0.0.33",
"@types/spark-md5": "^3.0.5",
"concurrently": "^9.2.1",
"ngx-fluent-cli": "https://github.com/HeyItsBATMAN/ngx-fluent-cli",
"oxlint": "^1.57.0",
"oxlint-tsgolint": "^0.18.1",
"ts-node": "~10.9.2",
Expand All @@ -96,6 +99,8 @@
},
"trustedDependencies": [
"@kompakkt/common",
"@kompakkt/plugins"
"@kompakkt/plugins",
"tree-sitter",
"tree-sitter-angular"
]
}
18 changes: 6 additions & 12 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { DragDropModule } from '@angular/cdk/drag-drop';
import { CommonModule, DATE_PIPE_DEFAULT_OPTIONS } from '@angular/common';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import {
ApplicationConfig,
LOCALE_ID,
importProvidersFrom,
inject,
provideAppInitializer,
} from '@angular/core';
import { ApplicationConfig, LOCALE_ID, importProvidersFrom } from '@angular/core';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
Expand Down Expand Up @@ -43,15 +37,16 @@ import {
withRouterConfig,
withRouterResources,
} from '@angular/router';
import { TranslatePipe } from 'src/app/pipes/translate.pipe';
import { NgxFluentPipe } from '@apappas1129/ngx-fluent';
import { RouteReuse } from 'src/app/route-reuse-strategy';
import { exploreTimingInterceptor } from 'src/app/services/interceptors/explore-timing-interceptor';
import { httpErrorInterceptor } from 'src/app/services/interceptors/http-error-interceptor';
import { httpOptionsInterceptor } from 'src/app/services/interceptors/http-options-interceptor';
import { jwtInterceptor } from './services/interceptors/jwt-interceptor';
import { TranslateService } from 'src/app/services/translate.service';
import { pluginProviders } from './app.plugin';
import { routes } from './app.routes';
import { provideNgxFluent } from '@apappas1129/ngx-fluent';
import { languageSources } from './app.fluent-sources';

export const appConfig: ApplicationConfig = {
providers: [
Expand Down Expand Up @@ -86,16 +81,15 @@ export const appConfig: ApplicationConfig = {
MatProgressBarModule,
MatSortModule,
),
TranslateService,
TranslatePipe,
NgxFluentPipe,
{ provide: RouteReuseStrategy, useClass: RouteReuse },
provideRouter(
routes,
withRouterConfig({ onSameUrlNavigation: 'reload' }),
withComponentInputBinding(),
withRouterResources(),
),
provideAppInitializer(() => inject(TranslateService).requestLanguage('en')),
provideNgxFluent({ defaultLocale: 'en', sources: languageSources }),
{ provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: { dateFormat: 'full' } },
{ provide: LOCALE_ID, useValue: 'en-US' },
provideAnimations(),
Expand Down
15 changes: 15 additions & 0 deletions src/app/app.fluent-sources.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const languageNames = {
en: 'English',
de: 'Deutsch (German)',
fr: 'Français (French)',
it: 'Italiano (Italian)',
es: 'Español (Spanish)',
mn: 'монгол хэл (Mongolian)',
} as const;

export type LanguageKey = keyof typeof languageNames;

export const languageSources = {
en: 'assets/i18n/en.ftl',
de: 'assets/i18n/de.ftl',
} as const satisfies Partial<Record<LanguageKey, `assets/i18n/${string}.ftl`>>;
Loading
Loading