diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 369fdfc..79ded25 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2333,6 +2333,11 @@ function drupal_container($reset = FALSE) { static $container = NULL; if ($reset || !isset($container)) { $container = new ContainerBuilder(); + // An interface language always needs to be available for t() and other + // functions. This default is overridden by drupal_language_initialize() + // during language negotiation. + $container->register(LANGUAGE_TYPE_INTERFACE, 'Drupal\\Core\\Language\\Language') + ->addMethodCall('extend', array(language_default())); } return $container; } diff --git a/core/modules/translation/tests/translation_test.module b/core/modules/translation/tests/translation_test.module index e3bb4b5..93f8b5a 100644 --- a/core/modules/translation/tests/translation_test.module +++ b/core/modules/translation/tests/translation_test.module @@ -11,3 +11,11 @@ function translation_test_node_insert($node) { drupal_write_record('node', $node, 'nid'); } + +/** + * Implements hook_boot(). + */ +function translation_test_boot() { + $oh_noes = t("Think of the poor @cute_animal!", array('@cute_animal' => 'kitteh')); +} +