Skip to content

Commit 49cad1b

Browse files
authored
Fix i18n routing (#397)
1 parent 5c76d08 commit 49cad1b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/aleph.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ export class Aleph implements IAleph {
105105
Object.assign(this.#importMap, getDefaultImportMap())
106106
}
107107
if (configFile) {
108-
Object.assign(this.#config, await loadConfig(configFile))
108+
const config = await loadConfig(configFile)
109+
Object.assign(this.#config, config, config.i18n)
109110
this.#pageRouting = new Routing(this.#config)
110111
}
111112

@@ -659,15 +660,15 @@ export class Aleph implements IAleph {
659660
async createMainJS(bundleMode = false): Promise<string> {
660661
const alephPkgUri = getAlephPkgUri()
661662
const alephPkgPath = alephPkgUri.replace('https://', '').replace('http://localhost:', 'http_localhost_')
662-
const { framework, basePath: basePath, i18n: { defaultLocale } } = this.#config
663+
const { framework, basePath: basePath, i18n: { defaultLocale, locales } } = this.#config
663664
const { routes } = this.#pageRouting
664665
const config: Record<string, any> = {
665666
basePath,
666667
appModule: this.#appModule?.specifier,
667668
routes,
668669
renderMode: this.#config.ssr ? 'ssr' : 'spa',
669670
defaultLocale,
670-
locales: [],
671+
locales,
671672
rewrites: this.#config.server.rewrites,
672673
}
673674

0 commit comments

Comments
 (0)