From 2ba702a67a3e1ade4fba287c9b2b5abb7d3b360e Mon Sep 17 00:00:00 2001 From: David Frerich Date: Thu, 31 May 2012 14:08:52 +0200 Subject: [PATCH 1/3] yml and linebreak fix https://github.com/schmittjoh/JMSTranslationBundle/issues/35 --- Translation/Dumper/YamlDumper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Translation/Dumper/YamlDumper.php b/Translation/Dumper/YamlDumper.php index 9bc02fb1..94b0752b 100644 --- a/Translation/Dumper/YamlDumper.php +++ b/Translation/Dumper/YamlDumper.php @@ -53,6 +53,7 @@ private function dumpStructureRecursively(array $structure) } if ($desc) { + $desc = str_replace(array("\r\n", "\n", "\r", "\t"), array('\r\n', '\n', '\r', '\t'), $desc); $this->writer->writeln('# Desc: '.$desc); } if ($meaning) { From aa21340cffef29a2f4028d2a0dcb819f3124e944 Mon Sep 17 00:00:00 2001 From: David Frerich Date: Thu, 31 May 2012 14:13:36 +0200 Subject: [PATCH 2/3] Keep empty strings https://github.com/schmittjoh/JMSTranslationBundle/issues/36 --- Model/Message.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Message.php b/Model/Message.php index c4c8c442..3944f0a7 100644 --- a/Model/Message.php +++ b/Model/Message.php @@ -116,7 +116,7 @@ public function isNew() public function getLocaleString() { - return $this->localeString ?: ($this->desc ?: $this->id); + return $this->localeString !== null ? $this->localeString : ($this->desc !== null ? $this->desc : $this->id); } /** From ebb7d4d7795af36382a36e744de1a3b70c81ec33 Mon Sep 17 00:00:00 2001 From: David Frerich Date: Thu, 31 May 2012 14:31:08 +0200 Subject: [PATCH 3/3] tabs => spaces --- Translation/Dumper/YamlDumper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translation/Dumper/YamlDumper.php b/Translation/Dumper/YamlDumper.php index 94b0752b..8a38a77f 100644 --- a/Translation/Dumper/YamlDumper.php +++ b/Translation/Dumper/YamlDumper.php @@ -53,7 +53,7 @@ private function dumpStructureRecursively(array $structure) } if ($desc) { - $desc = str_replace(array("\r\n", "\n", "\r", "\t"), array('\r\n', '\n', '\r', '\t'), $desc); + $desc = str_replace(array("\r\n", "\n", "\r", "\t"), array('\r\n', '\n', '\r', '\t'), $desc); $this->writer->writeln('# Desc: '.$desc); } if ($meaning) {