Checklist for production
While the installation instructions are sufficient to use
next-intl in your Next.js app, this checklist helps you ensure you're all set for production:
- If you're using TypeScript, you can take advantage of autocompletion and type safety for message keys by setting up a type for your messages.
- Please check the runtime requirements and optionally provide polyfills.
- If you're formatting dates and times, a time zone should be configured. By default, dates are formatted according to the time zone of the environment, which can lead to markup mismatches if the server and the user are located in different time zones. By supplying the
timeZoneexplicitly, you can ensure that dates and times are rendered the same way on the server as well as the client.
- If you're formatting relative dates and times, a global value for
nowcan be useful. This ensures that the server and client will render the same markup. Especially if you use caching for the responses of the server, the likelyhood of mismatches increases.
- To achieve consistent date, time and number formatting, it might be useful to set up global formats which ensure consistent formatting across the app.