अपने प्रश्न को पूछें और दस्तावेज़ का सारांश प्राप्त करें, इस पृष्ठ और आपके चुने हुए AI प्रदाता का उपयोग करके
संस्करण इतिहास
- "पूर्ण react-intlayer API (hooks, utilities, format/html/markdown subpaths) को re-export करें ताकि React Native ऐप केवल react-native-intlayer पर निर्भर रहे"v9.0.025/6/2026
- "सभी exports के लिए एकीकृत दस्तावेज़ीकरण"v8.0.021/1/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
react-native-intlayer पैकेज
react-native-intlayer पैकेज आवश्यक टूल्स प्रदान करता है ताकि Intlayer को React Native एप्लिकेशन्स में एकीकृत किया जा सके। यह react-intlayer की पूर्ण API (hooks और utilities) को React Native-ready IntlayerProvider के साथ re-export करता है, साथ ही React Native के लिए आवश्यक polyfills और Metro कॉन्फ़िगरेशन भी प्रदान करता है।
React Native ऐप में, सब कुछreact-native-intlayerसे import करें। आपकोreact-intlayerको सीधे install या import करने की आवश्यकता नहीं है।
इंस्टॉलेशन
कोड को क्लिपबोर्ड पर कॉपी करें
npm install react-native-intlayerएक्सपोर्ट्स
प्रोवाइडर
सभी डेटा सामग्री को स्पष्ट रूप से देखने के लिए तालिका को मोडल में खोलें
| Component | विवरण |
|---|---|
IntlayerProvider | Provider component जो आपके एप्लिकेशन को रैप करता है और Intlayer context प्रदान करता है। आवश्यक polyfills को स्वचालित रूप से लागू करता है। |
कोड को क्लिपबोर्ड पर कॉपी करें
import { IntlayerProvider } from "react-native-intlayer";Hooks और Utilities
ये react-intlayer से re-export किए जाते हैं, इसलिए आप इन्हें सीधे react-native-intlayer से import कर सकते हैं:
सभी डेटा सामग्री को स्पष्ट रूप से देखने के लिए तालिका को मोडल में खोलें
| Export | विवरण |
|---|---|
useIntlayer | किसी dictionary key के लिए localized content एक्सेस करें। |
useLocale | वर्तमान locale को पढ़ें और बदलें। |
useDictionary, useDictionaryAsync, useDictionaryDynamic, useLoadDynamic | विभिन्न तरीकों से dictionary content लोड करें। |
useI18n | i18next-compatible hook। |
t | Inline translation helper। |
getIntlayer, getDictionary | Imperative content getters। |
localeCookie, localeInStorage, setLocaleCookie, setLocaleInStorage, useLocaleCookie, useLocaleStorage | Locale persistence helpers। |
कोड को क्लिपबोर्ड पर कॉपी करें
import { useIntlayer, useLocale, t } from "react-native-intlayer";पॉलीफिल
सभी डेटा सामग्री को स्पष्ट रूप से देखने के लिए तालिका को मोडल में खोलें
| फ़ंक्शन | विवरण |
|---|---|
intlayerPolyfill | React Native के लिए Intlayer का समर्थन करने हेतु आवश्यक polyfills लागू करने वाला फ़ंक्शन। |
कोड को क्लिपबोर्ड पर कॉपी करें
import { intlayerPolyfill } from "react-native-intlayer";जब आपIntlayerProviderimport करते हैं तो polyfill स्वचालित रूप से लागू हो जाता है।intlayerPolyfillको मैन्युअल रूप से केवल तब कॉल करें जब provider mount होने से पहले polyfills की आवश्यकता हो।
Formatters
संख्या, दिनांक और अन्य Intl-आधारित formatting hooks /format subpath से उपलब्ध हैं:
कोड को क्लिपबोर्ड पर कॉपी करें
import { useNumber, useDate } from "react-native-intlayer/format";Markdown और HTML रेंडरिंग
कोड को क्लिपबोर्ड पर कॉपी करें
import { MarkdownProvider } from "react-native-intlayer/markdown";import { HTMLProvider } from "react-native-intlayer/html";Metro कॉन्फ़िगरेशन
The react-native-intlayer पैकेज Metro कॉन्फ़िगरेशन उपयोगिताएँ प्रदान करता है ताकि Intlayer React Native के साथ सही ढंग से काम करे।
सभी डेटा सामग्री को स्पष्ट रूप से देखने के लिए तालिका को मोडल में खोलें
| Function | Description |
|---|---|
configMetroIntlayer | Intlayer को तैयार करने और Metro कॉन्फ़िगरेशन को मर्ज करने वाला असिंक्रोनस फ़ंक्शन। |
configMetroIntlayerSync | Intlayer संसाधनों को तैयार किए बिना Metro कॉन्फ़िगरेशन को मर्ज करने वाला सिंक्रोनस फ़ंक्शन। |
exclusionList | Metro की blockList के लिए RegExp पैटर्न बनाता है ताकि बंडल से कंटेंट फ़ाइलें बाहर की जा सकें। |
कोड को क्लिपबोर्ड पर कॉपी करें
import { configMetroIntlayer } from "react-native-intlayer/metro";