GithubHelp home page GithubHelp logo

Comments (2)

dimaMachina avatar dimaMachina commented on June 2, 2024

#2566 (comment)

from nextra.

namnguyenthanhwork avatar namnguyenthanhwork commented on June 2, 2024

I am trying to use Nextra 3, and I have a few questions. Can you help me?

  1. Can I change <html lang={locale}></html> when I switch languages? If yes, how?
image
  1. If I configure i18n: undefined the select language does not appear and the switch does not change.
image

If I configure

 i18n: {
    locales: ['en', 'vi'],
    defaultLocale: 'vi',
  },

The switch changes, and the selected language appears.

image

I need to see the title in the current language. But I read your blog, and you recommend setting i18n: undefined. Can you give me an example using useRouter instead of locale or defaultLocale values?

image
  1. Example: I have two languages ['vi', 'en']. The default lang is vi, When I switch langs to en and I click logo brand (homepage in navbar), it redirects to lang vi. If lang current is en click logo and redirect homepage to en. How do you handle it?

Thank you for your help. @dimaMachina

from nextra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.