Globalization plugin deprecated

Hi all,
I need to init user language into my ionic 5 app but I read that globalization plugin has been deprecated.

I tried to replace it using this code:

     if (window.Intl && typeof window.Intl === 'object') {
        console.debug('Globalization API available');

        let l = navigator.language;
        console.debug("Current Language is " + l);

    } else {
        console.warn('Globalization API NOT available');
    }

II tested it in the browser but it doesn’t work. It always gives me “EN”.

Is it correct?

Thanks

1 Like