Skip to content

fix(core): resolve type mismatch in useGetLocale hook #6920

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arndom
Copy link
Contributor

@arndom arndom commented Aug 5, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

useTranslation().getLocale returns string | undefined instead of string.

What is the new behavior?

  • useTranslation().getLocale returns a string.
  • useGetLocale will throw an error if there is no i18n provider, ensuring a string as the return type of useTranslation().getLocale.

resolves #6812

Notes for reviewers

@arndom arndom requested a review from a team as a code owner August 5, 2025 17:26
Copy link

changeset-bot bot commented Aug 5, 2025

🦋 Changeset detected

Latest commit: 582892b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Aug 5, 2025

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 582892b
🔍 Latest deploy log https://app.netlify.com/projects/refine-doc-live-previews/deploys/68923eb13b0c810008ef9b55
😎 Deploy Preview https://deploy-preview-6920--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@alicanerdurmaz
Copy link
Member

Thanks @arndom, this PR is great, but it's a breaking change. We plan to release a major version next week with this PR. We can include this implementation in Refine v5. What do you think?

@arndom
Copy link
Contributor Author

arndom commented Aug 6, 2025

@alicanerdurmaz yh, sure, go ahead.

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.

[BUG] Inconsistent getLocale return type (string | undefined)
2 participants