Update to Drupal 8.0.6. For more information, see https://www.drupal.org/drupal-8.0.6-release-notes
This commit is contained in:
parent
4297c64508
commit
b11a755ba8
159 changed files with 2340 additions and 543 deletions
|
@ -35,13 +35,6 @@ class PluralTranslatableMarkup extends TranslatableMarkup {
|
|||
*/
|
||||
protected $translatedString;
|
||||
|
||||
/**
|
||||
* A bool that statically caches whether locale_get_plural() exists.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $localeEnabled;
|
||||
|
||||
/**
|
||||
* Constructs a new PluralTranslatableMarkup object.
|
||||
*
|
||||
|
@ -157,10 +150,13 @@ class PluralTranslatableMarkup extends TranslatableMarkup {
|
|||
* @return int
|
||||
*/
|
||||
protected function getPluralIndex() {
|
||||
if (!isset(static::$localeEnabled)) {
|
||||
static::$localeEnabled = function_exists('locale_get_plural');
|
||||
}
|
||||
if (function_exists('locale_get_plural')) {
|
||||
// We have to test both if the function and the service exist since in
|
||||
// certain situations it is possible that locale code might be loaded but
|
||||
// the service does not exist. For example, where the parent test site has
|
||||
// locale installed but the child site does not.
|
||||
// @todo Refactor in https://www.drupal.org/node/2660338 so this code does
|
||||
// not depend on knowing that the Locale module exists.
|
||||
if (function_exists('locale_get_plural') && \Drupal::hasService('locale.plural.formula')) {
|
||||
return locale_get_plural($this->count, $this->getOption('langcode'));
|
||||
}
|
||||
return -1;
|
||||
|
|
|
@ -60,7 +60,9 @@ trait StringTranslationTrait {
|
|||
* - 'langcode' (defaults to the current language): A language code, to
|
||||
* translate to a language other than what is used to display the page.
|
||||
* - 'context' (defaults to the empty context): The context the source
|
||||
* string belongs to.
|
||||
* string belongs to. See the
|
||||
* @link i18n Internationalization topic @endlink for more information
|
||||
* about string contexts.
|
||||
*
|
||||
* @return \Drupal\Core\StringTranslation\TranslatableMarkup
|
||||
* An object that, when cast to a string, returns the translated string.
|
||||
|
|
|
@ -38,7 +38,9 @@ interface TranslationInterface {
|
|||
* - 'langcode' (defaults to the current language): A language code, to
|
||||
* translate to a language other than what is used to display the page.
|
||||
* - 'context' (defaults to the empty context): The context the source
|
||||
* string belongs to.
|
||||
* string belongs to. See the
|
||||
* @link i18n Internationalization topic @endlink for more information
|
||||
* about string contexts.
|
||||
*
|
||||
* @return \Drupal\Core\StringTranslation\TranslatableMarkup
|
||||
* An object that, when cast to a string, returns the translated string.
|
||||
|
|
Reference in a new issue