Skip to content

Commit

Permalink
merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jan 30, 2024
1 parent b370253 commit fc65885
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
13 changes: 8 additions & 5 deletions packages/astro/src/i18n/vite-plugin-i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ export default function astroInternationalization({
name: 'astro:i18n',
enforce: 'pre',
config(config) {
const i18nConfig: I18nInternalConfig = { base, format, site, trailingSlash, i18n };
const finalConfig= {
...i18nConfig,
isBuild: isCommandBuild
const i18nConfig: I18nInternalConfig = {
base,
format,
site,
trailingSlash,
i18n,
isBuild: isCommandBuild,
};
return {
define: {
__ASTRO_INTERNAL_I18N_CONFIG__: JSON.stringify(finalConfig),
__ASTRO_INTERNAL_I18N_CONFIG__: JSON.stringify(i18nConfig),
},
};
},
Expand Down
7 changes: 4 additions & 3 deletions packages/astro/src/virtual-modules/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import * as I18nInternals from '../i18n/index.js';
import type { I18nInternalConfig } from '../i18n/vite-plugin-i18n.js';
export { normalizeTheLocale, toCodes, toPaths } from '../i18n/index.js';

// @ts-expect-error
const { trailingSlash, format, domains, site, i18n } = __ASTRO_INTERNAL_I18N_CONFIG__ as I18nInternalConfig;
const { defaultLocale, locales, routing, isBuild } = i18n!;
const { trailingSlash, format, site, i18n, isBuild } =
// @ts-expect-error
__ASTRO_INTERNAL_I18N_CONFIG__ as I18nInternalConfig;
const { defaultLocale, locales, routing, domains } = i18n!;
const base = import.meta.env.BASE_URL;

export type GetLocaleOptions = I18nInternals.GetLocaleOptions;
Expand Down

0 comments on commit fc65885

Please sign in to comment.