diff --git a/i18n/i18nTextCollector.php b/i18n/i18nTextCollector.php index cbde586c6..abe9c0cec 100644 --- a/i18n/i18nTextCollector.php +++ b/i18n/i18nTextCollector.php @@ -632,9 +632,13 @@ class i18nTextCollector_Writer_RailsYaml implements i18nTextCollector_Writer { } // Write YAML + $oldVersion = sfYaml::getSpecVersion(); + sfYaml::setSpecVersion('1.1'); $yamlHandler = new sfYaml(); // TODO Dumper can't handle YAML comments, so the context information is currently discarded - return $yamlHandler->dump(array($locale => $entitiesNested), 99); + $result = $yamlHandler->dump(array($locale => $entitiesNested), 99); + sfYaml::setSpecVersion($oldVersion); + return $result; } } diff --git a/tests/i18n/i18nTextCollectorTest.php b/tests/i18n/i18nTextCollectorTest.php index fbb9e0e8e..e527e8f97 100644 --- a/tests/i18n/i18nTextCollectorTest.php +++ b/tests/i18n/i18nTextCollectorTest.php @@ -417,6 +417,9 @@ PHP; $entities = array( 'Level1.Level2.EntityName' => array('Text', 'Context'), 'Level1.OtherEntityName' => array('Other Text', 'Other Context'), + 'Level1.BoolTest' => array('True'), + 'Level1.FlagTest' => array('No'), + 'Level1.TextTest' => array('Maybe') ); $yaml = <<assertEquals($yaml, Convert::nl2os($writer->getYaml($entities, 'de')));