Skip to content

Commit

Permalink
Add minimal implementation for session storages (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja authored Mar 6, 2025
1 parent 9041cbb commit 2a65a05
Show file tree
Hide file tree
Showing 22 changed files with 1,033 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ jobs:
id: version
uses: ./.github/actions/get-version
- name: Update version
run: sed -i "s/^leptos-fluent-macros = .*/leptos-fluent-macros = \"${{ steps.version.outputs.version }}\"/" leptos-fluent/Cargo.toml
run: sed -i "s/^leptos-fluent-macros = .*/leptos-fluent-macros = \"=${{ steps.version.outputs.version }}\"/" leptos-fluent/Cargo.toml
- name: Publish
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
Expand Down
21 changes: 19 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# CHANGELOG

## Unreleased - [0.2.6]
## 2025-03-07 - [0.2.6]

### New features

- Add a new parameter `fill_translations` to `leptos_fluent!` macro to add
messages found in `tr!` and `move_tr!` macros to Fluent translations files.
- Add next new parameters to `leptos_fluent!` macro to use browser's session
storage:
- `sessionstorage_key` to set the key to store the current language.
- `initial_language_from_sessionstorage` to set the initial language from
session storage.
- `set_language_to_sessionstorage` to set the current language to session
storage.
- `initial_language_from_sessionstorage_to_cookie` to set the initial
language from session storage to a cookie.
- `initial_language_from_sessionstorage_to_localstorage` to set the initial
language from session storage to local storage.
- `initial_language_from_sessionstorage_to_server_function` to set the
initial language from session storage to a server function.
- `initial_language_from_localstorage_to_sessionstorage` to set the initial
language from local storage to session storage.
- `initial_language_from_navigator_to_sessionstorage` to set the initial
language from the browser `navigator.languages` to session storage.

## 2025-03-06 - [0.2.5]

Expand Down Expand Up @@ -661,7 +678,7 @@ version to `0.1` during installation.

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

[0.2.6]: https://github.com/mondeja/leptos-fluent/compare/v0.2.5...master
[0.2.6]: https://github.com/mondeja/leptos-fluent/compare/v0.2.5...v0.2.6
[0.2.5]: https://github.com/mondeja/leptos-fluent/compare/v0.2.4...v0.2.5
[0.2.4]: https://github.com/mondeja/leptos-fluent/compare/v0.2.3...v0.2.4
[0.2.3]: https://github.com/mondeja/leptos-fluent/compare/v0.2.2...v0.2.3
Expand Down
Loading

0 comments on commit 2a65a05

Please sign in to comment.