Skip to content

fix: add namespaces for useTranslate, useTranlation and useDocumentTi…#7214

Open
indramal wants to merge 1 commit intorefinedev:mainfrom
indramal:main
Open

fix: add namespaces for useTranslate, useTranlation and useDocumentTi…#7214
indramal wants to merge 1 commit intorefinedev:mainfrom
indramal:main

Conversation

@indramal
Copy link

…tle hooks

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

What is the new behavior?

fixes (issue)

Notes for reviewers

Add these features as fixes

[FEAT] Add fallback and namespace for useDocumentTitle - #7198
[FEAT] Loading namespaces with useTranslation and useTranslate hooks. - #7195

@indramal indramal requested a review from a team as a code owner January 18, 2026 04:28
@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2026

🦋 Changeset detected

Latest commit: f48654c

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

This PR includes changesets to release 2 packages
Name Type
@refinedev/react-router Patch
@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
Member

@alicanerdurmaz alicanerdurmaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not using package-lock.json, we have pnpm

*/
export const useTranslation = () => {
const translate = useTranslate();
export const useTranslation = (ns?: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object would be better.

Suggested change
export const useTranslation = (ns?: string) => {
export const useTranslation = (props: { ns?: string }) => {

*/
export const useTranslate = () => {
export const useTranslate = ({
ns,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need tests for ns support

}

if (ns) {
finalOptions = { ns, ...finalOptions };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finalOptions can be string here. It can cause problems

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.

2 participants