Get all available translations

@param null $locale

@return mixed
6768
public function all($locale = null){

        if(!$locale){
            $locale = $this->getLocale();
        }

        $this->load($locale);

        $translations = collect([]);
        foreach($this->languages[$locale] as $key => $arg){
            $translations->put($key, $arg['value']);
        }

        return $translations;
    }
650461
public function locale($locale = null)
    {
        if ($locale) {
            $this->_locale = $locale;
        }
        if ($this->_locale) {
            return $this->_locale;
        }
        if (isset($this->_params['locale'])) {
            return $this->_params['locale'];
        }
    }
677461
protected function getFilterQuery($locale)
    {
        $qb = $this->createQueryBuilder('filter')
            ->addSelect('conditionGroups')
            ->addSelect('translations')
            ->addSelect('conditions')
            ->leftJoin(
                'filter.translations',
                'translations',
                'WITH',
                'translations.locale = :locale'
            )
            ->leftJoin('filter.conditionGroups', 'conditionGroups')
            ->leftJoin('conditionGroups.conditions', 'conditions')
            ->setParameter('locale', $locale);

        return $qb;
    }
783734
protected function getLocalise($locale = 'en-GB')
    {
        $locale = LanguageNormalize::toLanguageTag($locale);

        if (empty($this->localises[$locale]) || !($this->localises[$locale] instanceof LocaliseInterface)) {
            $tag = LanguageNormalize::getLocaliseClassPrefix($this->locale);

            $class = sprintf('Windwalker\\Language\\Localise\\%sLocalise', $tag);

            if (!class_exists($class)) {
                $class = 'Windwalker\\Language\\Localise\\NullLocalise';
            }

            $this->localises[$locale] = new $class();
        }

        return $this->localises[$locale];
    }
919616
private function getShippingQuery($locale = null)
    {
        $qb = $this->createQueryBuilder('shipping')
            ->leftJoin('shipping.deliveryAddress', 'deliveryAddress')
            ->leftJoin('shipping.status', 'status')
            ->leftJoin('shipping.shippingItems', 'shippingItems')
            ->leftJoin('shippingItems.item', 'items');

        if ($locale) {
            $qb->leftJoin('status.translations', 'statusTranslations', 'WITH', 'statusTranslations.locale = :locale')
                ->setParameter('locale', $locale);
        }
        return $qb;
    }
546263
public function findAll($locale)
    {
        $units = $this->unitRepository->findAllByLocale($locale);

        array_walk(
            $units,
            function (&$unit) use ($locale) {
                $unit = new Unit($unit, $locale);
            }
        );

        return $units;
    }
53234
public function findUsagesByLocales( $locale = null )
    {
        if ( empty( $locale ) )
        {
            $locale = $this->getLocale();
        }

        return $this->getMapper()
                    ->findUsagesByLocales( (array) $locale );
    }
324641
public function translationsFromFiles($locale)
    {
        $grouped = [];
        foreach ($this->hints as $name => $hint) {
            $languageDirectory = $hint . DIRECTORY_SEPARATOR . $locale;
            if (!is_dir($languageDirectory)) {
                continue;
            }
            $files = $this->filesystem->allFiles($languageDirectory);
            foreach ($files as $filename) {
                $file         = str_replace('.' . $filename->getExtension(), '', $filename->getFilename());
                $translations = array_dot(require $filename->getRealPath());
                foreach ($translations as $key => $translation) {
                    $grouped[$name] [$file . '.' . $key] = $translation;
                }
            }
        }
        return $grouped;
    }
834764
public function getTranslations(LocaleEntity $locale, TranslatableEntity $translatable)
    {
        $numPlurals = $locale->getPluralCount();

        $result = [
            'current' => null,
            'others' => [],
        ];
        $translations = $this->app->make(TranslationRepository::class)->findBy(['translatable' => $translatable, 'locale' => $locale], ['createdOn' => 'DESC']);
        $dh = $this->app->make('helper/date');
        $uh = $this->app->make(UserService::class);
        foreach ($translations as $translation) {
            /* @var \CommunityTranslation\Entity\Translation $translation */
            $texts = [];
            switch (($translatable->getPlural() === '') ? 1 : $numPlurals) {
                case 6:
                    $texts[] = $translation->getText5();
                    /* @noinspection PhpMissingBreakStatementInspection */
                case 5:
                    $texts[] = $translation->getText4();
                    /* @noinspection PhpMissingBreakStatementInspection */
                case 4:
                    $texts[] = $translation->getText3();
                    /* @noinspection PhpMissingBreakStatementInspection */
                case 3:
                    $texts[] = $translation->getText2();
                    /* @noinspection PhpMissingBreakStatementInspection */
                case 2:
                    $texts[] = $translation->getText1();
                    /* @noinspection PhpMissingBreakStatementInspection */
                case 1:
                default:
                    $texts[] = $translation->getText0();
                    break;
            }
            $item = [
                'id' => $translation->getID(),
                'createdOn' => $dh->formatPrettyDateTime($translation->getCreatedOn(), false, true),
                'createdBy' => $uh->format($translation->getCreatedBy()),
                'approved' => $translation->isApproved(),
                'translations' => array_reverse($texts),
            ];
            if ($translation->isCurrent()) {
                $item['currentSince'] = $dh->formatPrettyDateTime($translation->getCurrentSince(), false, true);
                $result['current'] = $item;
            } else {
                $result['others'][] = $item;
            }
        }

        return $result;
    }
533857
public function findAll($locale)
    {
        $currencies = $this->currencyRepository->findAll();

        array_walk(
            $currencies,
            function (&$currency) use ($locale) {
                $currency = new Currency($currency, $locale);
            }
        );

        return $currencies;
    }
626204
public function getReference($locale = null)
    {
        $locale = $locale ?: $this->getCurrentLocale();
        if (is_array($this->references) && isset($this->references[$locale])) {
            return $this->references[$locale];
        }
    }
207662
protected function getUnits($locale)
    {
        /** @var Status[] $units */
        $units = $this->get('sulu_product.unit_manager')->findAll($locale);

        $unitTitles = [];
        foreach ($units as $unit) {
            $unitTitles[] = [
                'id' => $unit->getId(),
                'name' => $unit->getName(),
            ];
        }

        return $unitTitles;
    }
328248
public function getI18n( $locale = null )
	{
		$locale = ( $locale !== null ? $locale : $this->getLocale()->getLanguageId() );

		if( !isset( $this->_i18n[$locale] ) ) {
			/// Locale ID %1$s
			throw new MShop_Exception( sprintf( 'Internationalization object not available for "%1$s"', $locale ) );
		}

		return $this->_i18n[$locale];
	}
663103
public function getNewTranslation($locale)
    {
        $modelName = $this->getTranslationModelName();
        $translation = new $modelName();
        $translation->setAttribute($this->getLocaleKey(), $locale);
        $this->translations->add($translation);

        return $translation;
    }
940480
public function getLangByLocale($locale)
    {
        // Event parameters prepare
        $arrayParameters = $this->makeArrayFromParameters(__METHOD__, func_get_args());

        // Sending service start event
        $arrayParameters = $this->sendEvent('melisengine_service_get_lang_by_local_start', $arrayParameters);

        // Service implementation start
        $langTable = $this->getServiceLocator()->get('MelisEngineTableCmsLang');
        $result = $langTable->getEntryByField('lang_cms_locale', $locale)->toArray();
        if(!isset($result[0]['lang_cms_locale'])) return null;
        $result = $result[0];
        // Service implementation end

        // Adding results to parameters for events treatment if needed
        $arrayParameters['results'] = $result;
        // Sending service end event
        $arrayParameters = $this->sendEvent('melisengine_service_get_lang_by_local_end', $arrayParameters);

        return $arrayParameters['results'];
    }
1134584
public function getAll($locale)
    {
        $qb = $this->createQueryBuilder('r');

        $qb->addSelect('t');
        $qb->innerJoin('r.translations', 't');
        $qb->andWhere('t.locale=:locale');
        $qb->setParameter(':locale', $locale);

        return $qb->getQuery()->execute();
    }
879532
public function language($locale = null)
    {
        if ($locale !== null) {
            $this->language = $locale;
        }

        return $this->language;
    }