1<?php 2/** 3 * Copyright since 2007 PrestaShop SA and Contributors 4 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA 5 * 6 * NOTICE OF LICENSE 7 * 8 * This source file is subject to the Open Software License (OSL 3.0) 9 * that is bundled with this package in the file LICENSE.md. 10 * It is also available through the world-wide-web at this URL: 11 * https://opensource.org/licenses/OSL-3.0 12 * If you did not receive a copy of the license and are unable to 13 * obtain it through the world-wide-web, please send an email 14 * to license@prestashop.com so we can send you a copy immediately. 15 * 16 * DISCLAIMER 17 * 18 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 19 * versions in the future. If you wish to customize PrestaShop for your 20 * needs please refer to https://devdocs.prestashop.com/ for more information. 21 * 22 * @author PrestaShop SA and Contributors <contact@prestashop.com> 23 * @copyright Since 2007 PrestaShop SA and Contributors 24 * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) 25 */ 26 27namespace PrestaShopBundle\Translation\Provider; 28 29use Symfony\Component\Translation\MessageCatalogue; 30 31/** 32 * Main translation provider for the Front Office 33 */ 34class FrontOfficeProvider extends AbstractProvider implements UseDefaultCatalogueInterface 35{ 36 public const DEFAULT_THEME_NAME = 'classic'; 37 38 /** 39 * {@inheritdoc} 40 */ 41 public function getTranslationDomains() 42 { 43 return [ 44 '^Shop*', 45 '^Modules(.*)Shop', 46 ]; 47 } 48 49 /** 50 * {@inheritdoc} 51 */ 52 public function getFilters() 53 { 54 return [ 55 '#^Shop*#', 56 '#^Modules(.*)Shop#', 57 ]; 58 } 59 60 /** 61 * {@inheritdoc} 62 */ 63 public function getIdentifier() 64 { 65 return 'front'; 66 } 67 68 /** 69 * @param null $themeName 70 * 71 * @return MessageCatalogue 72 */ 73 public function getDatabaseCatalogue($themeName = null) 74 { 75 if (null === $themeName) { 76 $themeName = self::DEFAULT_THEME_NAME; 77 } 78 79 return parent::getDatabaseCatalogue($themeName); 80 } 81 82 /**{@inheritdoc} 83 */ 84 public function getDefaultResourceDirectory() 85 { 86 return $this->resourceDirectory . DIRECTORY_SEPARATOR . 'default'; 87 } 88} 89