src/app/dbtext/model/GroupedDbtextCollection.php
public function t(string $key, array $args = null, N2nLocale ...$n2nLocales): string {
		$passedN2nLocales = $n2nLocales ?? $this->n2nLocales;
		$passedN2nLocales[] = N2nLocale::getFallback();
		
		if (empty($this->dbtextCollections)) {
			return $key;
		}

		$n2nLocales = [];
		foreach ($passedN2nLocales as $passedN2nLocale) {
			$n2nLocales[] = $passedN2nLocale;

			if (null !== $passedN2nLocale->getRegionId()) {
				$n2nLocales[] = new N2nLocale($passedN2nLocale->getLanguageId());
			}
		}

		foreach ($this->dbtextCollections as $dbtextCollection) {
			if ($dbtextCollection->has($key)) {
				return $dbtextCollection->t($key, $args, ...$n2nLocales);
			}
		}
		
		if (reset($this->dbtextCollections)) {
			return reset($this->dbtextCollections)->t($key);
		}
		
		return $key;
	}
public function t(string $key, array $args = null, N2nLocale ...$n2nLocales): string {
		$passedN2nLocales = $n2nLocales ?? $this->n2nLocales;
		$passedN2nLocales[] = N2nLocale::getFallback();
		
		if (empty($this->dbtextCollections)) {
			return $key;
		}

		$n2nLocales = [];
		foreach ($passedN2nLocales as $passedN2nLocale) {
			$n2nLocales[] = $passedN2nLocale;

			if (null !== $passedN2nLocale->getRegionId()) {
				$n2nLocales[] = new N2nLocale($passedN2nLocale->getLanguageId());
			}
		}

		foreach ($this->dbtextCollections as $dbtextCollection) {
			if ($dbtextCollection->has($key)) {
				return $dbtextCollection->t($key, $args, ...$n2nLocales);
			}
		}
		
		if (reset($this->dbtextCollections)) {
			return reset($this->dbtextCollections)->t($key);
		}
		
		return $key;
	}
Finds most fitting {@see TextT} by locales provided and returns modified {@see TextT::$str}.
{@see TextT::$str} args are replaced by {@see TextCollection::fillArgs()}.

@param string $key
@param array $args
@param N2nLocale[] ...$n2nLocales
@return string