Internalization dynamic route

Can anyone help with next js dynamic route translation ? import axiosInstance from ‘@/AxiosInstance’
import initTranslations from ‘@/libs/i18n/i18n’
import { BlocksRenderer } from ‘@strapi/blocks-react-renderer’
import Image from ‘next/image’

async function fetchData(locale?: string, id?: number) {
try {
const endpoint = id ? /news/${id} : ‘/news’
const response = await axiosInstance.get(endpoint, {
params: {
populate: ‘*’,
locale: locale,
},
})

    return response.data.data
} catch (error) {
    console.error('Error fetching data:', error)
    return []
}

}
export default async function page({
params: { locale, id },
}: {
params: { locale: string; id?: number }
}) {
const i18nNamespaces = [‘main’]
const { t } = await initTranslations(locale, i18nNamespaces)
const data = await fetchData(locale, id)
console.log(data)

This topic has been created from a Discord post (1272829466246385715) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord