src/PHPDish/Bundle/PaymentBundle/Twig/WalletExtension.php
public function translateWalletHistoryType($history)
    {
        switch ($history->getType()) {
            case PaymentInterface::TYPE_BUY_BOOK:
                $text = $this->translator->trans('payment.type.buy_book');
                break;
            case PaymentInterface::TYPE_FOLLOW_CATEGORY:
                $text = $this->translator->trans('payment.type.subscribe_category');
                break;
            case PaymentInterface::TYPE_CATEGORY_INCOME:
                $text = $this->translator->trans('payment.type.category_income');
                break;
            case PaymentInterface::TYPE_BOOK_INCOME:
                $text = $this->translator->trans('payment.type.book_income');
                break;
            case PaymentInterface::TYPE_WITHDRAW:
                $text = $this->translator->trans('payment.type.withdraw');
                break;
            default:
                $text =$this->translator->trans('payment.type.unknown');
        }
        return $text;
    }
public function translateWalletHistoryType($history)
    {
        switch ($history->getType()) {
            case PaymentInterface::TYPE_BUY_BOOK:
                $text = $this->translator->trans('payment.type.buy_book');
                break;
            case PaymentInterface::TYPE_FOLLOW_CATEGORY:
                $text = $this->translator->trans('payment.type.subscribe_category');
                break;
            case PaymentInterface::TYPE_CATEGORY_INCOME:
                $text = $this->translator->trans('payment.type.category_income');
                break;
            case PaymentInterface::TYPE_BOOK_INCOME:
                $text = $this->translator->trans('payment.type.book_income');
                break;
            case PaymentInterface::TYPE_WITHDRAW:
                $text = $this->translator->trans('payment.type.withdraw');
                break;
            default:
                $text =$this->translator->trans('payment.type.unknown');
        }
        return $text;
    }
翻译钱包历史类型
@param WalletHistoryInterface $history
@return string