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

Implement updateHead for Locale Changes #31

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

lucasferreiralimax
Copy link
Owner

This pull request implements a watcher for the $i18n.locale property to ensure the document head updates dynamically when the locale changes. The watcher emits an updateHead event, which is handled to update the title and other head elements accordingly.

Changed Page:

  1. Home: Update updateHead

    • Added functionality to emit updateHead when the locale changes in the Home component.
  2. Collaborators: Update updateHead and Title Complement

    • Updated the collaborators section to respond to the updateHead event, ensuring the title is complemented based on the current locale.
  3. About: Update updateHead and Title Complement

    • Implemented similar updates in the About section to reflect locale changes in the document head.
  4. NotFound: Update updateHead and Title Complement

    • Implemented similar updates in the NotFound section to reflect locale changes in the document head.

Changes Made:

  • Implemented a watcher for $i18n.locale in relevant components.
  • Emitted updateHead on locale changes.
  • Adjusted methods to update title and other head elements accordingly.

How to Test:

  1. Change the locale using the i18n settings.
  2. Observe that the document head updates correctly (title) based on the new locale.

Additional Notes:

  • Ensure that the methods handling the updateHead event are well-defined to cover all necessary updates in the head.
  • Review the changes to confirm the expected behavior across all components.

@lucasferreiralimax lucasferreiralimax self-assigned this Oct 11, 2024
@lucasferreiralimax lucasferreiralimax linked an issue Oct 11, 2024 that may be closed by this pull request
@lucasferreiralimax lucasferreiralimax merged commit 7d76c94 into master Oct 11, 2024
1 check passed
@lucasferreiralimax lucasferreiralimax deleted the update-head-title-i18n branch October 11, 2024 03:50
Copy link

Visit the preview URL for this PR (updated for commit 4a3684e):

https://criar-curriculo--pr31-update-head-title-i1-sy7y960o.web.app

(expires Fri, 18 Oct 2024 03:51:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 3d41c33fd8ec32dcb1fed11c6731e187f5a77c88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Watcher for Locale Changes to Update Head
1 participant