Return custom date.

@param string $language
@param bool   $fallbackLanguage

@return \DateTime
195216
public function getCustomDate($language, $fallbackLanguage = null)
    {
        $date = $this->getMappedField('date', $language, $fallbackLanguage);

        return $date;
    }
407806
def get_fallback_languages():
    """"""
    lang = translation.get_language()
    fallback_list = settings.FALLBACK_LANGUAGES.get(lang, None)
    if fallback_list:
        return fallback_list

    return settings.FALLBACK_LANGUAGES.get(lang[:2], [])
995708
public function getFallbackLanguages()
    {
        if (empty($this->fallback_languages)) {
            if ($this->enabled()) {
                $fallback_languages = $this->languages;

                if ($this->active) {
                    $active_extension = $this->active;
                    $key = \array_search($active_extension, $fallback_languages, true);
                    unset($fallback_languages[$key]);
                    array_unshift($fallback_languages, $active_extension);
                }
                $this->fallback_languages = $fallback_languages;
            }
            // always add english in case a translation doesn't exist
            $this->fallback_languages[] = 'en';
        }

        return $this->fallback_languages;
    }
105669
public static function getDefaultLanguage()
    {
        if (null === self::$defaultLanguage) {
            self::$defaultLanguage = LangQuery::create()->findOneByByDefault(1);

            if (null === self::$defaultLanguage) {
                throw new \RuntimeException("No default language is defined. Please define one.");
            }
        }

        return self::$defaultLanguage;
    }
737218
private function getLanguages($forcedLanguage = null, $fallbackLanguage = null)
    {
        if ($forcedLanguage !== null) {
            $languages = array($forcedLanguage);
        } else {
            $languages = $this->configResolver->getParameter('languages');
        }

        // Always add $fallbackLanguage, even if null, as last entry so that we can fallback to
        // main/initial language if domain supports it.
        $languages[] = $fallbackLanguage;

        return $languages;
    }
1006017
protected function _getRoutesWithFallback($language) {
        $routesFile = $this->view->config()->resources->router->routesFile->{$language};
        $config = new Garp_Config_Ini($routesFile, APPLICATION_ENV);
        
        if ($config->routes) {
            return $config->routes->toArray();
        } 
        
        $routesFile = $this->view->config()->resources->router->routesFile->generic;
        $config = new Garp_Config_Ini($routesFile, APPLICATION_ENV);
        return $config->routes->toArray();
    }
730801
public function getFallbackLanguage($forLanguage = null)
    {
        if ($this->_fallbackLanguage === null) {
            $this->_fallbackLanguage = Yii::$app->sourceLanguage;
        }
        if ($forLanguage === null) {
            return $this->_fallbackLanguage;
        }
        if ($this->_fallbackLanguage === false) {
            return $forLanguage;
        }

        if (is_array($this->_fallbackLanguage)) {
            if (isset($this->_fallbackLanguage[$forLanguage])) {
                return $this->_fallbackLanguage[$forLanguage];
            }
            // check fallback de-DE -> de
            $fallbackLanguage = substr($forLanguage, 0, 2);
            if ($forLanguage !== $fallbackLanguage) {
                return $fallbackLanguage;
            }
            // when no fallback is available, use the first defined fallback
            return reset($this->_fallbackLanguage);
        }

        // check fallback de-DE -> de
        $fallbackLanguage = substr($forLanguage, 0, 2);
        if ($forLanguage !== $fallbackLanguage) {
            return $fallbackLanguage;
        }
        return $this->_fallbackLanguage;
    }
185046
private function getFallbackLocale($locale = null)
    {
        if ($locale && $this->isLocaleCountryBased($locale)) {
            if ($fallback = $this->getLanguageFromCountryBasedLocale($locale)) {
                return $fallback;
            }
        }

        $locales = $this->getLocales();

        foreach ($locales as $code) {
            if ($this->getTranslationByLocaleKey($code) !== null)
                return $code;
        }

        return app()->make('config')->get('revy.translatable.fallback_locale');
    }
240847
public function getFallbackLocale(): self
    {
        if ($this->variant !== null) {
            return $this->withVariant(null);
        }

        if ($this->region !== null) {
            return $this->withRegion(null);
        }

        if ($this->script !== null) {
            return $this->withScript(null);
        }

        return $this;
    }
1374533
public function get($key, array $replace = array(), $locale = null, $fallback = true)
	{
		list($namespace, $group, $item) = $this->parseKey($key);

		// Here we will get the locale that should be used for the language line. If one
		// was not passed, we will use the default locales which was given to us when
		// the translator was instantiated. Then, we can load the lines and return.
		foreach ($this->parseLocale($locale) as $locale)
		{
			$this->load($namespace, $group, $locale);

			$line = $this->getLine(
				$namespace, $group, $locale, $item, $replace
			);

			// If we cannot find the translation group in the database nor as a file
			// an entry in the database will be added to the translations.
			// Keep in mind that a file cannot be used from that point.
			if(!self::isNamespaced($namespace) && is_null($line)) {
				// Database stuff
				$this->database->addTranslation($locale, $group, $key);
			}

			if ( ! is_null($line)) break;
		}

		// If the line doesn't exist, we will return back the key which was requested as
		// that will be quick to spot in the UI if language keys are wrong or missing
		// from the application's language files. Otherwise we can return the line.
		if ( ! isset($line)) return $key;

		return $line;
	}
367312
def get_fallback_languages(self):
        
        lang_dict = get_language_settings(self._current_language)
        fallbacks = [lang for lang in lang_dict['fallbacks'] if lang != self._current_language]
        return fallbacks or []
692740
public function setLanguage($language)
    {
        if (Switcher::getRedirect() == 'route') {
            return redirect(Switcher::getRedirectRoute())->withCookie(Switcher::setLanguage($language));
        }
        if (Switcher::getRedirect() == 'locale') {
            return redirect(Switcher::getLocalBack($language))->withCookie(Switcher::setLanguage($language));
        }
        return back()->withCookie(Switcher::setLanguage($language));
    }
474510
public Translation getWithFallBack(Locale locale) {
        Translation tr = get(locale.toString());
        if (tr == null) {
            tr = get(locale.getLanguage());
            if (tr == null)
                tr = get("en");
        }
        return tr;
    }
284835
public Locale getFallbackLocale() {

		Locale locale = null;
		if (this.fallbackToSystemLocale) {
			locale = Locale.getDefault();
		} else {
			locale = new Locale("", "");
		}

		return locale;
	}
984188
public function getTitle($language = null)
    {
        $fallbackLanguage = key($this->titles);
        if ($language === null) {
            $language = $fallbackLanguage;
        }

        if (!empty($this->titles[$language])) {
            return $this->titles[$language];
        }

        if (!empty($this->titles[$fallbackLanguage])) {
            return $this->titles[$fallbackLanguage];
        }

        $title = false;
        try {
            $defaultUrl = $this->getDefaultUrl();

            if ($defaultUrl) {
                $title = $defaultUrl->getHostname();
            }
        } catch (\Exception $e) {
        }

        if (!$title) {
            return '(No title)';
        }

        return $title;
    }
33360
public function getFallbackLocale()
    {
        if (!$this->getLocalizedMeta()) {
            return;
        }

        $fallbackLocale = $this->getLocalizedMeta()->getLocale();

        return $fallbackLocale !== $this->locale ? $fallbackLocale : null;
    }
968180
def get_fallback_languages(self, language_code=None, site_id=None):
        
        choices = self.get_active_choices(language_code, site_id=site_id)
        return choices[1:]