Skip to content

getRelativeLocaleUrl/getAbsoluteLocaleUrl with empty path appends trailing slash #10743

Description

@mversic

📚 Subject area/topic

getRelativeLocaleUrl/getAbsoluteLocaleUrl

📋 Page(s) affected (or suggested, for new content)

https://docs.astro.build/en/reference/modules/astro-i18n/#getrelativelocaleurl

📋 Description of content that is out-of-date or incorrect

It seems that the following example is incorrect:

getRelativeLocaleUrl("fr", "");
// returns /fr

it should be either this:

getRelativeLocaleUrl("fr", "");
// returns /fr/

or an empty string should not be allowed

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

Relevant discussion: withastro/astro#13032

Metadata

Metadata

Assignees

No one assigned

    Labels

    improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions