Coder Social home page Coder Social logo

Comments (4)

amannn avatar amannn commented on June 3, 2024 1

Hello @lupus-magnus,

the advanced example has a shared PageLayout component that is used on all pages and in turn renders a Navigation. Can you have a look if this works for you?

Note that the part where message namespaces are computed in the advanced example is entirely optional and only relevant for performance-senstive apps.

from next-intl.

amannn avatar amannn commented on June 3, 2024 1

It depends a bit. The advanced example is really focused on only providing only the minimum of messages for every page and so for such a situation I would suggest do add getStaticProps for every page which filters the messages – yes.

If that's less of a concern for you, you can also utilize App.getInitialProps to fetch general messages and hand them over to the provider.

from next-intl.

lupus-magnus avatar lupus-magnus commented on June 3, 2024

Hey! Thank you for answering it

In the mentioned example, there are two pages and you use GetStaticProps in both of them, to access the PageLayout messages.

If I have -let's say- 20 pages, the right thing to do would be to manually add that GetStaticProps in all of them for displaying my translated navbar?

from next-intl.

amannn avatar amannn commented on June 3, 2024

I hope your question was answered! Closing due to inactivity …

from next-intl.

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.