locales.php 641 B

1234567891011121314151617
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. if (isset($_GET['type']) && $_GET['type'] == 'deployed') {
  7. $themePath = isset($_GET['theme_path']) ? $_GET['theme_path'] : 'adminhtml/Magento/backend';
  8. $directory = __DIR__ . '/../../../../pub/static/' . $themePath;
  9. $locales = array_diff(scandir($directory), ['..', '.']);
  10. } else {
  11. require_once __DIR__ . DIRECTORY_SEPARATOR . 'bootstrap.php';
  12. $localeConfig = $magentoObjectManager->create(\Magento\Framework\Locale\Config::class);
  13. $locales = $localeConfig->getAllowedLocales();
  14. }
  15. echo implode('|', $locales);