Skip to content

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

Merged
alicanerdurmaz merged 6 commits into
refinedev:feat/refine-5/packagesfrom
arndom:fix/core/use-get-locale-type-mismatch
Aug 21, 2025
Merged

fix(core): resolve type mismatch in useGetLocale hook#6920
alicanerdurmaz merged 6 commits into
refinedev:feat/refine-5/packagesfrom
arndom:fix/core/use-get-locale-type-mismatch

Conversation

@arndom

@arndom arndom commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

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
@changeset-bot

changeset-bot Bot commented Aug 5, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fefa1ba

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

@netlify

netlify Bot commented Aug 5, 2025

Copy link
Copy Markdown

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
Copy Markdown
Collaborator

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

arndom commented Aug 6, 2025

Copy link
Copy Markdown
Contributor Author

@alicanerdurmaz yh, sure, go ahead.

@alicanerdurmaz
alicanerdurmaz changed the base branch from main to feat/refine-5/packages August 18, 2025 11:49
@alicanerdurmaz
alicanerdurmaz merged commit dd75178 into refinedev:feat/refine-5/packages Aug 21, 2025
5 of 11 checks passed
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