Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\language;
|
Chris@0
|
4
|
Chris@0
|
5 use Drupal\Core\Language\LanguageInterface;
|
Chris@0
|
6 use Drupal\Core\Language\LanguageManagerInterface;
|
Chris@0
|
7
|
Chris@0
|
8 /**
|
Chris@0
|
9 * Common interface for language negotiation services.
|
Chris@0
|
10 */
|
Chris@0
|
11 interface ConfigurableLanguageManagerInterface extends LanguageManagerInterface {
|
Chris@0
|
12
|
Chris@0
|
13 /**
|
Chris@0
|
14 * Rebuild the container to register services needed on multilingual sites.
|
Chris@0
|
15 */
|
Chris@0
|
16 public static function rebuildServices();
|
Chris@0
|
17
|
Chris@0
|
18 /**
|
Chris@0
|
19 * Returns the language negotiator.
|
Chris@0
|
20 *
|
Chris@0
|
21 * @return \Drupal\language\LanguageNegotiatorInterface
|
Chris@0
|
22 * The language negotiator.
|
Chris@0
|
23 */
|
Chris@0
|
24 public function getNegotiator();
|
Chris@0
|
25
|
Chris@0
|
26 /**
|
Chris@0
|
27 * Injects the language negotiator.
|
Chris@0
|
28 *
|
Chris@0
|
29 * @param \Drupal\language\LanguageNegotiatorInterface $negotiator
|
Chris@0
|
30 * The language negotiator.
|
Chris@0
|
31 */
|
Chris@0
|
32 public function setNegotiator(LanguageNegotiatorInterface $negotiator);
|
Chris@0
|
33
|
Chris@0
|
34 /**
|
Chris@0
|
35 * Returns all the defined language types including fixed ones.
|
Chris@0
|
36 *
|
Chris@0
|
37 * A language type maybe configurable or fixed. A fixed language type is a
|
Chris@0
|
38 * type whose language negotiation methods are module-defined and not altered
|
Chris@0
|
39 * through the user interface.
|
Chris@0
|
40 *
|
Chris@0
|
41 * @return array
|
Chris@0
|
42 * An array of language type machine names.
|
Chris@0
|
43 */
|
Chris@0
|
44 public function getDefinedLanguageTypes();
|
Chris@0
|
45
|
Chris@0
|
46 /**
|
Chris@0
|
47 * Stores language types configuration.
|
Chris@0
|
48 *
|
Chris@0
|
49 * @param array $config
|
Chris@0
|
50 * An indexed array with the following keys_
|
Chris@0
|
51 * - configurable: an array of configurable language type names.
|
Chris@0
|
52 * - all: an array of all the defined language type names.
|
Chris@0
|
53 */
|
Chris@0
|
54 public function saveLanguageTypesConfiguration(array $config);
|
Chris@0
|
55
|
Chris@0
|
56 /**
|
Chris@0
|
57 * Updates locked system language weights.
|
Chris@0
|
58 */
|
Chris@0
|
59 public function updateLockedLanguageWeights();
|
Chris@0
|
60
|
Chris@0
|
61 /**
|
Chris@0
|
62 * Gets a language config override object.
|
Chris@0
|
63 *
|
Chris@0
|
64 * @param string $langcode
|
Chris@0
|
65 * The language code for the override.
|
Chris@0
|
66 * @param string $name
|
Chris@0
|
67 * The language configuration object name.
|
Chris@0
|
68 *
|
Chris@0
|
69 * @return \Drupal\language\Config\LanguageConfigOverride
|
Chris@0
|
70 * The language config override object.
|
Chris@0
|
71 */
|
Chris@0
|
72 public function getLanguageConfigOverride($langcode, $name);
|
Chris@0
|
73
|
Chris@0
|
74 /**
|
Chris@0
|
75 * Gets a language configuration override storage object.
|
Chris@0
|
76 *
|
Chris@0
|
77 * @param string $langcode
|
Chris@0
|
78 * The language code for the override.
|
Chris@0
|
79 *
|
Chris@0
|
80 * @return \Drupal\Core\Config\StorageInterface
|
Chris@0
|
81 * A storage object to use for reading and writing the
|
Chris@0
|
82 * configuration override.
|
Chris@0
|
83 */
|
Chris@0
|
84 public function getLanguageConfigOverrideStorage($langcode);
|
Chris@0
|
85
|
Chris@0
|
86 /**
|
Chris@0
|
87 * Returns the standard language list excluding already configured languages.
|
Chris@0
|
88 *
|
Chris@0
|
89 * @return array
|
Chris@0
|
90 * A list of standard language names keyed by langcode.
|
Chris@0
|
91 */
|
Chris@0
|
92 public function getStandardLanguageListWithoutConfigured();
|
Chris@0
|
93
|
Chris@0
|
94 /**
|
Chris@0
|
95 * Gets the negotiated language method ID.
|
Chris@0
|
96 *
|
Chris@0
|
97 * @param string $type
|
Chris@0
|
98 * (optional) The language type; e.g., the interface or the content
|
Chris@0
|
99 * language.
|
Chris@0
|
100 *
|
Chris@0
|
101 * @return string
|
Chris@0
|
102 * The negotiated language method ID.
|
Chris@0
|
103 */
|
Chris@0
|
104 public function getNegotiatedLanguageMethod($type = LanguageInterface::TYPE_INTERFACE);
|
Chris@0
|
105
|
Chris@0
|
106 }
|