Get the difference in a human readable format in the current locale from current instance to an other
instance given (or now if null given).

@return string
777420
public function timespan($other = null, $timezone = null)
    {
        if (!$other instanceof DateTimeInterface) {
            $other = static::parse($other, $timezone);
        }

        return $this->diffForHumans($other, [
            'join' => ', ',
            'syntax' => CarbonInterface::DIFF_ABSOLUTE,
            'options' => CarbonInterface::NO_ZERO_DIFF,
            'parts' => -1,
        ]);
    }
827213
public function getCurrentLocale()
    {
        if (is_null($this->currentLocale)) {
            $this->setCurrentLocaleByContext();

            if (!is_admin() || Router::isFrontendAjax()) {
                $this->applyLocale();
            }
        }

        return $this->currentLocale;
    }
1218473
public function getStringsToLocalize() {
		$switched_locale = switch_to_locale( Modules\Export\Export::locale() );

		$localized = [
			/**
			 * Filter the label used for post types (front matter/parts/chapters/back matter) in the TOC and section headings.
			 *
			 * @since 5.6.0
			 *
			 * @param string $label
			 * @param array $args
			 *
			 * @return string Filtered label
			 */
			'chapter' => apply_filters( 'pb_post_type_label', __( 'Chapter', 'pressbooks' ), [ 'post_type' => 'chapter' ] ),
			/**
			 * Filter the label used for post types (front matter/parts/chapters/back matter) in the TOC and section headings.
			 *
			 * @since 5.6.0
			 *
			 * @param string $label
			 * @param array $args
			 *
			 * @return string Filtered label
			 */
			'part' => apply_filters( 'pb_post_type_label', __( 'Part', 'pressbooks' ), [ 'post_type' => 'part' ] ),
		];

		if ( $switched_locale ) {
			restore_previous_locale();
		}

		return $localized;

	}
1174375
public static function getThousandsSeparator()
    {
        if (!isset(self::$thousandsSeparator)) {
            $localeconv = localeconv();
            self::$thousandsSeparator = ($localeconv['thousands_sep'] != '')
                ? $localeconv['thousands_sep'] : $localeconv['mon_thousands_sep'];

            if (self::$thousandsSeparator == '') {
                // Default to .
                self::$thousandsSeparator = ',';
            }
        }
        return self::$thousandsSeparator;
    }
503803
public function LastChange()
    {
        $today = new \DateTime(); // This object represents current date/time
        $today->setTime(0, 0, 0); // reset time part, to prevent partial comparison

        $dateTime = \DateTime::createFromFormat('Y-m-d H:i:s', $this->Changed);
        if (!($dateTime instanceof \DateTime)) {
            return '---';
        }

        $todayTime = $dateTime;
        $todayTime->setTime(0, 0, 0); // reset time part, to prevent partial comparison

        $diff = $today->diff($todayTime);
        $diffDays = (integer) $diff->format('%R%a'); // Extract days count in interval

        switch ($diffDays) {
            case 0:
                return _t('ContentElement.today', 'Today') . ' ' . date('H:i', strtotime($this->Changed));
                break;
            case -1:
                return _t('ContentElement.yesterday', 'Yesterday') . ' ' . date('H:i', strtotime($this->Changed));
                break;
            default:
                return date('j. M H:i', strtotime($this->Changed));
        }
    }
135381
public function getDisplayVersion()
    {
        if ($this->isDevVersion()) {
            return t(/*i18n: %s is a version*/'%s development series', substr($this->version, strlen(static::DEV_PREFIX)));
        } else {
            return $this->version;
        }
    }
1222199
public function getLocale() : ?string 
    {
        if ( ! $this->hasLocale()) {
            $this->setLocale($this->getDefaultLocale());
        }
        return $this->locale;
    }
423340
public function formatDifference(Difference $difference, $locale = 'en')
    {
        $translationKey = \sprintf('%s.%s', $difference->getUnit()->getName(), $difference->isPast() ? 'past' : 'future');

        return $this->translator->transChoice(
            $translationKey,
            $difference->getQuantity(),
            ['%count%' => $difference->getQuantity()],
            'difference',
            $locale
        );
    }
780455
public function getFormattedTotalNetSum()
    {
        return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->oxorder__oxtotalnetsum->value, $this->getOrderCurrency());
    }
237245
public function getDuration()
	{
		$started = (is_null($this->started)) ? new \DateTime('now') : $this->started;
		$stopped = (is_null($this->stopped)) ? new \DateTime('now') : $this->stopped;

		return $started->diff($stopped);
	}
169693
public function getTimeFormat()
    {
        if ($this->getHTML5()) {
            // Browsers expect ISO 8601 times, localisation is handled on the client
            $this->setTimeFormat(DBTime::ISO_TIME);
        }

        if ($this->timeFormat) {
            return $this->timeFormat;
        }

        // Get from locale
        return $this->getFrontendFormatter()->getPattern();
    }
72776
protected function localeSequence()
    {
        if ($this->localeSequence) {
            return $this->localeSequence;
        }

        if ($this->localeFallbacks) {
            $this->localeSequence = $this->localeFallbacks;
        }

        if (!$this->locale) {
            return $this->localeSequence;
        }

        if (!strpos($this->locale, '_') ) {
            array_unshift($this->localeSequence, $this->locale);
            return $this->localeSequence;
        }

        $base = explode('_', $this->locale, 2)[0];

        array_unshift($this->localeSequence, $base);
        array_unshift($this->localeSequence, $this->locale);

        return $this->localeSequence;
    }
1234394
public function getDoubledLocale()
    {
        $locale = $this->getLocale();

        if (stristr($locale, '-') === false) {
            $locale = $locale.'-'.$locale;
        }

        return $locale;
    }
775393
public function getTransfered()
    {
        $base = log($this->transfered, 1024);
        $suffixes = array(
            '',
            'K',
            'M',
            'G',
            'T',
        );
        return round(pow(1024, $base - floor($base)), 2) . ' ' . $suffixes[floor($base)];
    }
936569
public function getFormatter()
    {
        $locale = $this->getLocale();
        $currency = $this->getCurrency();
        if ($currency) {
            $locale .= '@currency=' . $currency;
        }
        return NumberFormatter::create($locale, NumberFormatter::CURRENCY);
    }
701867
public function getFormattedDiscount()
    {
        return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->oxorder__oxdiscount->value, $this->getOrderCurrency());
    }
110012
public function getTranslation()
    {
        $attributeValueTranslation = $this->getTranslationByLocale($this->locale);

        if (!$attributeValueTranslation) {
            $attributeValueTranslation = $this->getTranslationByLocale($this->fallbackLocale);
        }

        if (!$attributeValueTranslation) {
            $attributeValueTranslation = new AttributeValueTranslation();
            $attributeValueTranslation->setLocale($this->locale);
            $attributeValueTranslation->setAttributeValue($this->entity);

            $this->entity->addTranslation($attributeValueTranslation);
        }

        return $attributeValueTranslation;
    }