public static function addLocaleToCollection(Collection $collection, LocaleInterface $locale)
    {
        $exist = $collection->exists(function ($key, LocaleInterface $el) use ($locale) {
            return $el->isLocale($locale->getLocale());
        });
        if (!$exist) {
            $collection->add($locale);
        }

        return $collection;
    }
public static function addLocaleToCollection(Collection $collection, LocaleInterface $locale)
    {
        $exist = $collection->exists(function ($key, LocaleInterface $el) use ($locale) {
            return $el->isLocale($locale->getLocale());
        });
        if (!$exist) {
            $collection->add($locale);
        }

        return $collection;
    }
public static function addLocaleToCollection ( Collection $ collection , LocaleInterface $ locale ) { $ exist = $ collection -> exists ( function ( $ key , LocaleInterface $ el ) use ( $ locale ) { return $ el -> isLocale ( $ locale -> getLocale ( ) ) ; } ) ; if ( ! $ exist ) { $ collection -> add ( $ locale ) ; } return $ collection ; }
add Locale to Collection.

@param Collection      $collection
@param LocaleInterface $locale

@return Collection
add Locale to Collection .