Skip to content

Update usePreferredLanguage.mdx #171

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

Merged
merged 1 commit into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions usehooks.com/src/content/hooks/usePreferredLanguage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import HookDescription from "../../components/HookDescription.astro";
import StaticCodeContainer from "../../components/StaticCodeContainer.astro";

<HookDescription name={frontmatter.name}>
Basically, what this hook does is that, it takes a parameter with value true
or false and toggles that value to opposite. It's useful when we want to take
some action into it's opposite action, for example: show and hide modal, show
more/show less text, open/close side menu.
The usePreferredLanguage hook automatically adapts to the preferred language
of the user. The hook reactively returns a string that represents the
preferred language of the user, as set in the browser settings.
</HookDescription>

<div class="reference">
Expand All @@ -25,7 +24,7 @@ import StaticCodeContainer from "../../components/StaticCodeContainer.astro";
<div class="table-container">
| Name | Type | Description |
| ------------- | ------ | ------------------------------------------------------------------------------------------------------------- |
| preferredLang | string | The hook returns a string that represents the preferred language of the user, as set in the browser settings. |
| language | string | The hook returns a string that represents the preferred language of the user, as set in the browser settings. |
</div>
</div>

Expand Down