If navigator.language returns en-US, but I only want en because I don't care about the locale, is there a preferred way to do this? Does angular have anything built in for this or should I just split on the -?
use js String.prototype.slice() method.
navigator.language.slice(0,2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With