Skip to content

Commit aab4cf4

Browse files
Merge pull request #3581 from opral/changeset-release/main
Version Packages [skip preview]
2 parents 5d458dd + 36b93b0 commit aab4cf4

File tree

28 files changed

+299
-254
lines changed

28 files changed

+299
-254
lines changed

.changeset/chilly-readers-fail.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/clever-dogs-sing.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

.changeset/dull-seals-clap.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.changeset/polite-spies-argue.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/silver-bugs-hammer.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/sour-actors-type.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

.changeset/vary-accept-language-header.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

inlang/packages/cli/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @inlang/cli
22

3+
## 3.0.12
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [22089a2]
8+
- @inlang/sdk@2.4.9
9+
310
## 3.0.11
411

512
### Patch Changes

inlang/packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inlang/cli",
3-
"version": "3.0.11",
3+
"version": "3.0.12",
44
"private": false,
55
"publishConfig": {
66
"access": "public"

inlang/packages/paraglide/paraglide-js/CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# @inlang/paraglide-js
22

3+
## 2.1.0
4+
5+
### Minor Changes
6+
7+
- 4255bd5: Provide functions for getting the preferred language on server and client.
8+
9+
This defines two new functions for getting the preferred language:
10+
11+
- `extractLocaleFromHeader`: Extracts the locale from the accept-language header on the server.
12+
- `extractLocaleFromNavigator`: Extracts the locale from the navigator.languages array on the client.
13+
14+
The code was already present in the `@inlang/paraglide-js` package, but it was not exported. Now it is exported so that
15+
it can be used in custom strategies.
16+
17+
- dc287f1: Implement custom strategy concept for locale resolution.
18+
19+
This introduces a new way to define custom locale resolution strategies alongside built-in strategies. Custom strategies provide a cleaner, more composable approach compared to overwriting `getLocale()` and `setLocale()` functions directly.
20+
21+
**New APIs:**
22+
23+
- `defineCustomClientStrategy()`: Define custom strategies for client-side locale resolution
24+
- `defineCustomServerStrategy()`: Define custom strategies for server-side locale resolution
25+
26+
**Key features:**
27+
28+
- Custom strategies must follow the pattern `custom-<name>` where `<name>` contains only alphanumeric characters
29+
- Can be combined with built-in strategies in the strategy array
30+
- Respect strategy order for fallback handling
31+
- Support both client and server environments
32+
- Provide better error isolation and type safety
33+
34+
**Usage example:**
35+
36+
```js
37+
import { defineCustomClientStrategy } from "./paraglide/runtime.js";
38+
39+
defineCustomClientStrategy("custom-sessionStorage", {
40+
getLocale: () => sessionStorage.getItem("user-locale") ?? undefined,
41+
setLocale: (locale) => sessionStorage.setItem("user-locale", locale),
42+
});
43+
```
44+
45+
Then include in your strategy configuration:
46+
47+
```js
48+
compile({
49+
strategy: ["custom-sessionStorage", "cookie", "baseLocale"],
50+
});
51+
```
52+
53+
### Patch Changes
54+
55+
- 4c0b997: perf(paraglide): improve bundle size by removing message id fallback for fully translated messages
56+
- 9621803: Add Vary: Accept-Language header when preferredLanguage strategy is used
57+
58+
Paraglide middleware now automatically sets the `Vary: Accept-Language` header when performing redirects based on the `preferredLanguage` strategy. This indicates to clients (CDN cache, crawlers, etc.) that the response will be different depending on the `Accept-Language` header, ensuring proper caching behavior and SEO compliance.
59+
60+
Closes https://github.com/opral/inlang-paraglide-js/issues/522
61+
62+
- Updated dependencies [22089a2]
63+
64+
365
## 2.0.13
466
567
### Patch Changes

0 commit comments

Comments
 (0)