setupTranslations method

void setupTranslations(
  1. Locale locale
)

Setup translations for given locale. In normal use cases it shouldn't be called manually.

Implementation

void setupTranslations(Locale locale) {
  // ignore: unnecessary_null_comparison
  if (locale != null) {
    final String languageCode = locale.languageCode;
    translations = pipFlutterPlayerConfiguration.translations
            ?.firstWhereOrNull((translations) =>
                translations.languageCode == languageCode) ??
        _getDefaultTranslations(locale);
  } else {
    PipFlutterPlayerUtils.log("Locale is null. Couldn't setup translations.");
  }
}