Author:
    Creation:2026-06-13Last update:2026-06-13

    NuxtJS I18n से Intlayer में माइग्रेट करें

    अपने Nuxt एप्लिकेशन को @nuxtjs/i18n से Intlayer में माइग्रेट करना Nuxt adapter मॉड्यूल का उपयोग करके एक सहज प्रक्रिया है।

    क्या करना है

    प्रोजेक्ट को इनिशियलाइज़ करने के लिए, यह चलाएं:

    bash
    npx intlayer init

    यह intlayer.config.ts को सेट अप करेगा। फिर, अपनी nuxt.config.ts modules array में Intlayer Nuxt module (जैसे @intlayer/nuxt-i18n) जोड़ें। यह आपके application के लिए compat configuration को automatically apply करता है।

    यह हुड के अंदर क्या करता है

    @nuxtjs/i18n vue-i18n को wrap करता है जबकि Nuxt-specific routing composables (useLocalePath, useSwitchLocalePath, <NuxtLinkLocale>) प्रदान करता है।

    हुड के अंदर:

    • Translations: सभी string translation कार्यों के लिए @intlayer/vue-i18n compat layer पर नेटिवली निर्भर करता है (vue-i18n formats, pipe plurals, और reactivity को पूरी तरह से support करता है)।
    • Routing: Intlayer के localized URL helpers का उपयोग करके routing composables को mirror करता है।
    • Configuration: आपके intlayer.config.ts से सीधे availableLocales और default settings को पढ़ता है ताकि Nuxt pages को स्वचालित रूप से coordinate किया जा सके।