Skip to content

I18n#2

Open
SudoCat wants to merge 5 commits intomainfrom
i18n
Open

I18n#2
SudoCat wants to merge 5 commits intomainfrom
i18n

Conversation

@SudoCat
Copy link
Copy Markdown
Owner

@SudoCat SudoCat commented Jun 20, 2023

Changes

Add rudimentary i18n support

Core

  • localised routes with locale prefixes
  • default locale with no prefix
  • redirect to default locale if prefix enabled
  • localise injected routes
  • verify SSG

Stretch

  • Route translations (e.g. about -> a-propos)
  • Astro locale as global (rather than parameter)
  • Domain support (I'm not convinced this is an Astro responsibility - seems more of a CDN/Proxy responsibility)
  • Opt-in/out API extending vite-scanner-plugin, similar to preprender.
  • Simple locale detection via Accept-Language header

Known issues:

  • when a page is default locale, Astro.params.locale will be undefined. Ideally this should be prepopulated, or the locale would be moved to a new object on the Astro.global

Testing

// todo: testing

Docs

// todo: documentation

SudoCat pushed a commit that referenced this pull request Jun 20, 2023
…withastro#7235)

* test: add unit tests

* fix: prioritize prerendered routes

* chore: fix test

* add comment

* test: try avoiding race condition

* chore: changeset

* try avoiding race conditions attempt #2

* try avoiding race conditions (attempt 3)

* final fix hopefuly

* tet: add more tests

* sort conflicting dynamic routes aplhabetically

* test: fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant