public static function getI18n(
        $backendContext,
        $requestedLangId,
        ModelCriteria &$search,
        $currentLocale,
        $columns,
        $foreignTable,
        $foreignKey,
        $forceReturn = false,
        $localeAlias = null
    ) {
        // If a lang has been requested, find the related Lang object, and get the locale
        if ($requestedLangId !== null) {
            $localeSearch = LangQuery::create()->findByIdOrLocale($requestedLangId);

            if ($localeSearch === null) {
                throw new \InvalidArgumentException(
                    sprintf(
                        'Incorrect lang argument given : lang %s not found',
                        $requestedLangId
                    )
                );
            }

            $locale = $localeSearch->getLocale();
        } else {
            // Use the currently defined locale
            $locale = $currentLocale;
        }

        // Call the proper method depending on the context: front or back
        if ($backendContext) {
            self::getBackEndI18n($search, $locale, $columns, $foreignTable, $foreignKey, $localeAlias);
        } else {
            self::getFrontEndI18n($search, $locale, $columns, $foreignTable, $foreignKey, $forceReturn, $localeAlias);
        }

        return $locale;
    }