अपने प्रश्न को पूछें और दस्तावेज़ का सारांश प्राप्त करें, इस पृष्ठ और आपके चुने हुए AI प्रदाता का उपयोग करके
संस्करण इतिहास
- "Init history"v9.0.013/6/2026
इस पृष्ठ की सामग्री एक AI द्वारा अनुवादित की गई है।
अंग्रेजी में मूल सामग्री के अंतिम संस्करण देखेंIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
next-intl से Intlayer में माइग्रेट करें
एक संपूर्ण और विस्तृत चरण-दर-चरण ट्यूटोरियल के लिए, कृपया हमारी पूरी next-intl माइग्रेशन गाइड देखें।
next-intl से Intlayer में माइग्रेशन करने से आप अपने एप्लिकेशन रूटिंग और सिंटैक्स को पूरी तरह से बिना किसी परेशानी के बनाए रख सकते हैं।
क्या करना है
अपने रिपोजिटरी में निम्नलिखित कमांड निष्पादित करें:
कोड को क्लिपबोर्ड पर कॉपी करें
npx intlayer initयह एक intlayer.config.ts बनाएगा। अपने next.config.ts में, प्लगइन रैपर का उपयोग करें ताकि next-intl aliases को @intlayer/next-intl की ओर निर्बाध रूप से इंजेक्ट किया जा सके।
कोड को क्लिपबोर्ड पर कॉपी करें
import type { NextConfig } from "next";import { createNextIntlPlugin } from "@intlayer/next-intl/plugin";const withIntlayer = createNextIntlPlugin();const nextConfig: NextConfig = {};export default withIntlayer(nextConfig);यह हुड के नीचे क्या करता है
बंडलर रैपर अनुवादों को प्रतिस्थापित करता है, लेकिन next-intl/navigation फीचर्स को बरकरार रखता है (उदाहरण के लिए Link, redirect, usePathname)।
हुड के नीचे:
- ICU runtime: Plurals (
=0,one,other), select/selectordinal,#arguments, और formatted args ({ts, date, long}) साझाresolveMessage(..., 'icu')resolver का उपयोग करके सही तरीके से चलते हैं। useTranslations()&getTranslations(): bare scope कॉल्स पहले key सेगमेंट को सही dictionary identifier के रूप में निकालते हैं। Nested namespaces gracefully dictionary paths और prefixes में विभाजित होते हैं।- Rich formatting:
t.rich()औरt.markup()दोनों पूरी तरह से natively लागू किए गए हैं, HTML-जैसे नोड्स को rendered React chunks में परिवर्तित करते हैं। useFormatter:relativeTime,list,dateTimeRange, और कॉन्फ़िगरेशन से named formats core nativeIntlformatters को bridge करते हैं।