ConfigurableLanguageManagerInterface.php 2.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php

/**
 * @file
 * Contains \Drupal\language\ConfigurableLanguageManagerInterface
 */

namespace Drupal\language;

use Drupal\Core\Language\LanguageManagerInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * Common interface for language negotiation services.
 */
interface ConfigurableLanguageManagerInterface extends LanguageManagerInterface {

18 19 20 21 22
  /**
   * Rebuild the container to register services needed on multilingual sites.
   */
  public static function rebuildServices();

23 24 25
  /**
   * Returns the language negotiator.
   *
26
   * @return \Drupal\language\LanguageNegotiatorInterface
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
   *   The language negotiator.
   */
  public function getNegotiator();

  /**
   * Injects the language negotiator.
   *
   * @param \Drupal\language\LanguageNegotiatorInterface $negotiator
   *   The language negotiator.
   */
  public function setNegotiator(LanguageNegotiatorInterface $negotiator);

  /**
   * Returns all the defined language types including fixed ones.
   *
   * A language type maybe configurable or fixed. A fixed language type is a
   * type whose language negotiation methods are module-defined and not altered
   * through the user interface.
   *
   * @return array
47
   *   An array of language type machine names.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
   */
  public function getDefinedLanguageTypes();

  /**
   * Stores language types configuration.
   *
   * @param array
   *   An indexed array with the following keys_
   *   - configurable: an array of configurable language type names.
   *   - all: an array of all the defined language type names.
   */
  public function saveLanguageTypesConfiguration(array $config);

  /**
   * Updates locked system language weights.
   */
  public function updateLockedLanguageWeights();

66 67 68 69 70 71 72 73
  /**
   * Gets a language config override object.
   *
   * @param string $langcode
   *   The language code for the override.
   * @param string $name
   *   The language configuration object name.
   *
74
   * @return \Drupal\language\Config\LanguageConfigOverride
75 76 77 78
   *   The language config override object.
   */
  public function getLanguageConfigOverride($langcode, $name);

79 80 81 82 83 84 85 86 87 88 89 90
  /**
   * Gets a language configuration override storage object.
   *
   * @param string $langcode
   *   The language code for the override.
   *
   * @return \Drupal\Core\Config\StorageInterface $storage
   *   A storage object to use for reading and writing the
   *   configuration override.
   */
  public function getLanguageConfigOverrideStorage($langcode);

91
  /**
92
   * Returns the standard language list excluding already configured languages.
93 94
   *
   * @return array
95
   *   A list of standard language names keyed by langcode.
96
   */
97
  public function getStandardLanguageListWithoutConfigured();
98

99
}