अपने प्रश्न को पूछें और दस्तावेज़ का सारांश प्राप्त करें, इस पृष्ठ और आपके चुने हुए 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 Translate से Intlayer में माइग्रेट करें
next-translate से Intlayer में माइग्रेट करना एक लगभग drop-in replacement है जो आपके मौजूदा syntax और tags को बरकरार रखता है।
क्या करें
अपने प्रोजेक्ट में Intlayer को initialize करें:
कोड को क्लिपबोर्ड पर कॉपी करें
npx intlayer initCLI आपके configuration को scaffold करेगा। फिर आप अपने next.config.ts में Intlayer plugin को apply कर सकते हैं, जो build-time subpath aliases को next-translate/useTranslation से @intlayer/next-translate में map करता है।
यह हुड के अंदर क्या करता है
next-translate hooks जैसे useTranslation('ns'), t('ns:key.path'), और <Trans> component प्रदान करता है।
हुड के अंदर:
- Interpolation & Plurals: यह
react-i18nextadapter behavior पर निकटता से निर्भर करता है।{{var}}placeholders और pluralization कोkey_0,key_one, औरkey_otherजैसे suffixes से mapped किया जाता है। <Trans>component: HTML-ish tag parsing के लिए सीधे समर्थित है साथ ही एक array-basedcomponentsprop के साथ।- Namespaces: Subpath aliasing सुनिश्चित करता है कि आपका
useTranslationबिना मैनुअल संशोधन के सही internal dictionary namespaces को reference करता है।