findSystemLocale function

Future<String> findSystemLocale()

Find the system locale, accessed as window.navigator.language, and set it as the default for internationalization operations in the Intl.systemLocale variable.

Implementation

Future<String> findSystemLocale() {
  Intl.systemLocale = Intl.canonicalizedLocale(window.navigator.language);
  return Future.value(Intl.systemLocale);
}