Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Fix i18n routing #397

Merged
merged 1 commit into from
Sep 18, 2021
Merged
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
7 changes: 4 additions & 3 deletions server/aleph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export class Aleph implements IAleph {
Object.assign(this.#importMap, getDefaultImportMap())
}
if (configFile) {
Object.assign(this.#config, await loadConfig(configFile))
const config = await loadConfig(configFile)
Object.assign(this.#config, config, config.i18n)
this.#pageRouting = new Routing(this.#config)
}

Expand Down Expand Up @@ -659,15 +660,15 @@ export class Aleph implements IAleph {
async createMainJS(bundleMode = false): Promise<string> {
const alephPkgUri = getAlephPkgUri()
const alephPkgPath = alephPkgUri.replace('https://', '').replace('http://localhost:', 'http_localhost_')
const { framework, basePath: basePath, i18n: { defaultLocale } } = this.#config
const { framework, basePath: basePath, i18n: { defaultLocale, locales } } = this.#config
const { routes } = this.#pageRouting
const config: Record<string, any> = {
basePath,
appModule: this.#appModule?.specifier,
routes,
renderMode: this.#config.ssr ? 'ssr' : 'spa',
defaultLocale,
locales: [],
locales,
rewrites: this.#config.server.rewrites,
}

Expand Down