Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n #48

Merged
merged 6 commits into from
Jan 29, 2024
Merged

i18n #48

merged 6 commits into from
Jan 29, 2024

Conversation

endoooo
Copy link
Contributor

@endoooo endoooo commented Jan 29, 2024

there are a lot of places where I didn't added the gettext() call, but the main goal of this PR was the i18n setup.

I've added some code to keep track of the profile locale preference, and restore it in live and dead views.

- created `LantternWeb.Localization` module to update locale option on live views using `on_mount` hook

- added `current_locale` to `Profile`

- adjusted `Identity.build_flat_profile/1` to add name and school attrs to the existing profile instead of creating a new profile struct manually

- added `on_dismiss` attr to `<.error_block>` component

- added `pt_BR` locale to project (and some initial translations for menu)
- renamed `LantternWeb.Localization` to `LantternWeb.LocalizationHelpers`, and added `translate_struct_list/4` function

- added translations to `<.flash_group>` component

- added translations to `<.markdown_supported>` component

- created `schools` and `taxonomy` domain translations (not available at compile time)
- fixed fkey constraints in delete changeset for `Activity` and `Strand` schemas
- added `LocalizationHelpers.put_locale/2` plug to `:browser` pipeline

- removed locale related code from `:fetch_current_user` plug

- created `LocalizationHelpers.get_html_lang/0` to get current backend locale and format it to add to html tag

- adjusted menu component to `redirect` instead of `push_navigate` on language change to update html tag lang attr
@endoooo endoooo linked an issue Jan 29, 2024 that may be closed by this pull request
Closed
2 tasks
@endoooo endoooo merged commit 6b2fb58 into main Jan 29, 2024
2 checks passed
@endoooo endoooo deleted the i18n branch January 29, 2024 18:40
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.

i18n
1 participant