अपने प्रश्न को पूछें और दस्तावेज़ का सारांश प्राप्त करें, इस पृष्ठ और आपके चुने हुए 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
Lingui से Intlayer में माइग्रेट करें
यदि आपका प्रोजेक्ट वर्तमान में Lingui के macro-based compilation पर निर्भर करता है, तो Intlayer में ट्रांजिशन करने से आप अपने शक्तिशाली macro workflows को बनाए रखते हुए उन्हें Intlayer की JSON compilation strategy के साथ नेटिवली बैक कर सकते हैं।
क्या करना है
शुरुआत करने के लिए, अपने प्रोजेक्ट में Intlayer को इनिशियलाइज़ करें:
कोड को क्लिपबोर्ड पर कॉपी करें
npx intlayer initयह आपका intlayer.config.ts बनाता है। सुनिश्चित करें कि आप अपने बिल्ड स्टेप में @lingui/babel-plugin-lingui-macro / @lingui/swc-plugin को Intlayer compiler से पहले चलाने के लिए रखते हैं। फिर, bundler plugin alias का उपयोग करके @lingui/core और @lingui/react को @intlayer/lingui में रूट करें।
यह हुड के नीचे क्या करता है
Lingui macros (जैसे t`Hello ${name}` और <Trans>) का उपयोग करता है जो runtime calls जैसे i18n._(id, values) में compile होते हैं।
हुड के नीचे:
- Macros: वे पहले की तरह ही compile होते हैं, जिससे आपके source syntax में कोई व्यवधान नहीं होता है।
- Runtime translation: aliased
i18n._()Intlayer dictionaries का उपयोग करता है। explicitly named IDs और hashed IDs दोनों को पूरी तरह से Intlayer के.posync plugins का उपयोग करके mapped किया जाता है ताकि keys को securely aggregate और prune किया जा सके। - ICU capabilities: pluralization, selection, और ICU variants के लिए support Intlayer के unified ICU parser की वजह से robust रहता है, जिससे identical rendering outputs सुनिश्चित होते हैं।