BCLabelTranslatorStrategy.php 620 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of sonata-project.
  4. *
  5. * (c) 2010 Thomas Rabaix
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\AdminBundle\Translator;
  11. class BCLabelTranslatorStrategy implements LabelTranslatorStrategyInterface
  12. {
  13. /**
  14. * {@inheritDoc}
  15. */
  16. public function getLabel($label, $context = '', $type = '')
  17. {
  18. if ($context == 'breadcrumb') {
  19. return sprintf('%s.%s_%s', $context, $type, strtolower($label));
  20. }
  21. return ucfirst(strtolower($label));
  22. }
  23. }