i18next / next-i18next

The easiest way to translate your NextJs apps.
https://next.i18next.com
MIT License
5.62k stars 764 forks source link

imported link from 'next-i18next` not effect on link behavior #468

Closed Zoha closed 5 years ago

Zoha commented 5 years ago

Hi. I using this plugin in my next project and I have an issue. imported link from my next-i18next file is working fine as a regular link but when I have a url like domain.com/fa and i want to navigate to another page for example contact page I want url to be domain.com/fa/contact but instead this will navigate to domain.com/contact. even though that language is changed ( because of last request and cookie) but still link not effected on navigating behavior. how I use code is exactly like example of docs.

sample code :

import React, { Component } from "react";
import { withTranslation, Link} from "../i18n";

class Index extends Component {
    // states and other stuff
    render() {
        const { t } = this.props;
        return (
            <div className="index-parallax">
        <h1>{t('a translated sample')}</h1>
                <Link href="/contact">
            <a>Contact Link</a>
        </Link>
            </div>
        );
    }
}

export default withTranslation(["common"])(Index);

can you guess what the problem is? did I do something wrong?

isaachinman commented 5 years ago

Follow the docs.

Zoha commented 5 years ago

OK. problem was the package version. I have no idea why a prev version was installed