Skip to content

Commit 2a65a05

Browse files
authored
Add minimal implementation for session storages (#294)
1 parent 9041cbb commit 2a65a05

File tree

22 files changed

+1033
-107
lines changed

22 files changed

+1033
-107
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ jobs:
374374
id: version
375375
uses: ./.github/actions/get-version
376376
- name: Update version
377-
run: sed -i "s/^leptos-fluent-macros = .*/leptos-fluent-macros = \"${{ steps.version.outputs.version }}\"/" leptos-fluent/Cargo.toml
377+
run: sed -i "s/^leptos-fluent-macros = .*/leptos-fluent-macros = \"=${{ steps.version.outputs.version }}\"/" leptos-fluent/Cargo.toml
378378
- name: Publish
379379
run: |
380380
cargo login ${{ secrets.CRATES_TOKEN }}

CHANGELOG.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
11
# CHANGELOG
22

3-
## Unreleased - [0.2.6]
3+
## 2025-03-07 - [0.2.6]
44

55
### New features
66

77
- Add a new parameter `fill_translations` to `leptos_fluent!` macro to add
88
messages found in `tr!` and `move_tr!` macros to Fluent translations files.
9+
- Add next new parameters to `leptos_fluent!` macro to use browser's session
10+
storage:
11+
- `sessionstorage_key` to set the key to store the current language.
12+
- `initial_language_from_sessionstorage` to set the initial language from
13+
session storage.
14+
- `set_language_to_sessionstorage` to set the current language to session
15+
storage.
16+
- `initial_language_from_sessionstorage_to_cookie` to set the initial
17+
language from session storage to a cookie.
18+
- `initial_language_from_sessionstorage_to_localstorage` to set the initial
19+
language from session storage to local storage.
20+
- `initial_language_from_sessionstorage_to_server_function` to set the
21+
initial language from session storage to a server function.
22+
- `initial_language_from_localstorage_to_sessionstorage` to set the initial
23+
language from local storage to session storage.
24+
- `initial_language_from_navigator_to_sessionstorage` to set the initial
25+
language from the browser `navigator.languages` to session storage.
926

1027
## 2025-03-06 - [0.2.5]
1128

@@ -661,7 +678,7 @@ version to `0.1` during installation.
661678

662679
- Added all ISO-639-1 and ISO-639-2 languages.
663680

664-
[0.2.6]: https://github.com/mondeja/leptos-fluent/compare/v0.2.5...master
681+
[0.2.6]: https://github.com/mondeja/leptos-fluent/compare/v0.2.5...v0.2.6
665682
[0.2.5]: https://github.com/mondeja/leptos-fluent/compare/v0.2.4...v0.2.5
666683
[0.2.4]: https://github.com/mondeja/leptos-fluent/compare/v0.2.3...v0.2.4
667684
[0.2.3]: https://github.com/mondeja/leptos-fluent/compare/v0.2.2...v0.2.3

0 commit comments

Comments
 (0)