अपने प्रश्न को पूछें और दस्तावेज़ का सारांश प्राप्त करें, इस पृष्ठ और आपके चुने हुए 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
Transloco से Intlayer में माइग्रेट करें
यदि आपकी Angular एप्लिकेशन वर्तमान में @jsverse/transloco का उपयोग करती है, तो आप हमारे compat adapter का उपयोग करके Intlayer में माइग्रेट कर सकते हैं। यह संक्रमण आपको अपने मौजूदा template syntax को बनाए रखते हुए Intlayer की शक्तिशाली dictionary संरचना का उपयोग करने की अनुमति देता है।
क्या करें
अपने प्रोजेक्ट में बस initialization command चलाएं:
कोड को क्लिपबोर्ड पर कॉपी करें
npx intlayer initयह आवश्यक intlayer.config.ts configuration generate करेगा। फिर आप अपने Transloco imports को @intlayer/transloco modules के साथ replace कर सकते हैं या build aliases पर निर्भर रह सकते हैं।
यह हुड के नीचे क्या करता है
Transloco scopes और एक TranslocoService (translate, selectTranslate) का उपयोग करता है, साथ ही structural directives (*transloco="let t") और pipes (| transloco)।
हुड के नीचे:
- Scopes: Intlayer dictionary keys के लिए स्वाभाविक रूप से मैप करते हैं, bundle optimization के लिए एक बेहतरीन pruning story प्रदान करते हैं।
- Service & Directives: Intlayer का Angular adapter seamlessly providers को बदलता है, जिससे आपके मौजूदा template pipes और directives Intlayer dictionaries के विरुद्ध strings को resolve कर सकते हैं।
- Build time parsing: TypeScript analyzer
instant/getcalls को पहचानता है, और fallback pruning सुनिश्चित करता है कि सही है यहां तक कि जब template usage statically trackable न हो।