Skip to content

Commit

Permalink
Merge pull request #3155 from axel-rock/main
Browse files Browse the repository at this point in the history
fix opral/inlang-paraglide-js#234: update LANG_COOKIE_NAME to follow rfc6265 standard
  • Loading branch information
samuelstroschein authored Oct 7, 2024
2 parents 622cf64 + f8565fa commit 7e8df0e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .changeset/new-news-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@inlang/paraglide-sveltekit": patch
---

Fixes https://github.com/opral/inlang-paraglide-js/issues/234.

Paraglide SvelteKit used the cookie name `paraglide:lang` which is
not compliant with rfc6265 standards for cookie names. SvelteKit
recently introduced strict cookie parsing which caused
`paraglide:lang` to be rejected.

The cookie name has been updated to `paraglide_lang` to be compliant.

```diff
-paraglide:lang
+paraglide_lang
```

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export const NO_TRANSLATE_ATTRIBUTE = "data-no-translate"

/** The key with which `invalidate` is called when the language changes */
export const LANGUAGE_CHANGE_INVALIDATION_KEY = "paraglide:lang"
export const LANGUAGE_CHANGE_INVALIDATION_KEY = "paraglide_lang"

/** The name of the cookie in which the language is stored */
export const LANG_COOKIE_NAME = "paraglide:lang"
export const LANG_COOKIE_NAME = "paraglide_lang"

0 comments on commit 7e8df0e

Please sign in to comment.