Creation:2026-01-21Last update:2026-01-21

    getLocale फ़ंक्शन दस्तावेज़

    The getLocale function allows you to detect the locale from a given string, such as a URL or a path.

    उपयोग

    import { getLocale } from "intlayer";
    
    const locale = getLocale("/fr/about");
    
    // आउटपुट: 'fr'

    पैरामीटर

    पैरामीटर प्रकार विवरण
    path string जिस पथ या स्ट्रिंग से locale निकाला जाएगा।

    लौटने वाला मान

    पहचाना गया locale, या यदि कोई locale नहीं मिला तो डिफ़ॉल्ट locale।