Skip to content

Usage with base path set in a config #21

Closed
@dallyh

Description

@dallyh

I cannot get my head around on how to use this integration with base path. Everything works fine when the base path is not set, that is when the page is located for ex. under http://localhost:4321/projects/, but with base path, no locales get resolved and return 404 - for ex. http://localhost:4321/website-concept/en/projects/.

image

My config for locales is set like this:

import { defineConfig } from "astro/config";
import { i18n } from "astro-i18n-aut/integration";
import react from "@astrojs/react";

const defaultLocale = "cs";
const locales = {
    en: "en-US", 
    cs: "cs-CZ",
};

// https://astro.build/config
export default defineConfig({
    site: "https://some-website.com",
    base: "/website-concept",
    trailingSlash: "always",
    integrations: [
        react(),
        i18n({
            locales,
            defaultLocale,
        }),
    ],
});

Thanks for any help with this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions