Index: trunk/extensions/LiveTranslate/includes/LT_TMXParser.php |
— | — | @@ -69,6 +69,15 @@ |
70 | 70 | protected $insideSegment; |
71 | 71 | |
72 | 72 | /** |
| 73 | + * Boolean to keep track of if the XML parser is inside a node that should be ingored. |
| 74 | + * |
| 75 | + * @since 0.4 |
| 76 | + * |
| 77 | + * @var boolean |
| 78 | + */ |
| 79 | + protected $insideIgnoreNode; |
| 80 | + |
| 81 | + /** |
73 | 82 | * Constructor. |
74 | 83 | * |
75 | 84 | * @since 0.4 |
— | — | @@ -135,6 +144,9 @@ |
136 | 145 | $this->currentTranslation = ''; |
137 | 146 | $this->insideSegment = true; |
138 | 147 | break; |
| 148 | + case 'ut' : |
| 149 | + $this->insideIgnoreNode = true; |
| 150 | + break; |
139 | 151 | } |
140 | 152 | } |
141 | 153 | |
— | — | @@ -160,6 +172,9 @@ |
161 | 173 | case 'seg': |
162 | 174 | $this->insideSegment = false; |
163 | 175 | break; |
| 176 | + case 'ut' : |
| 177 | + $this->insideIgnoreNode = false; |
| 178 | + break; |
164 | 179 | } |
165 | 180 | } |
166 | 181 | |
— | — | @@ -172,7 +187,7 @@ |
173 | 188 | * @param string $data The second parameter, data, contains the character data as a string. |
174 | 189 | */ |
175 | 190 | protected function segmentContentHandler( $parser, $data ) { |
176 | | - if ( $this->insideSegment ) { |
| 191 | + if ( $this->insideSegment && !$this->insideIgnoreNode ) { |
177 | 192 | $this->currentTranslation .= $data; |
178 | 193 | } |
179 | 194 | } |