Revert "[BUGFIX] Invalid fallback for non-localized labels"
authorXavier Perseguers <xavier@typo3.org>
Wed, 15 Aug 2012 17:34:09 +0000 (19:34 +0200)
committerXavier Perseguers <xavier@typo3.org>
Fri, 31 Aug 2012 09:02:50 +0000 (11:02 +0200)
This reverts commit 1e0e808121febca3da6a300fbbc148c8088b4020

Real bug is in Extbase: #36905 and #39569

Fixes: #39814
Change-Id: I602795bb5c6925cf48fcd5a4eaecfffc95367fcc
Reviewed-on: http://review.typo3.org/13802
Reviewed-by: Dominique Feyer
Tested-by: Dominique Feyer
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/l10n/parser/class.t3lib_l10n_parser_xliff.php

index e7f5c0c..d6fc051 100644 (file)
@@ -57,18 +57,10 @@ class t3lib_l10n_parser_Xliff extends t3lib_l10n_parser_AbstractXml {
                                                );
                                        } else {
                                                        // @todo Support "approved" attribute
-                                               if (!empty($translationElement->target)) {
-                                                       $parsedData[(string)$translationElement['id']][0] = array(
-                                                               'source' => (string)$translationElement->source,
-                                                               'target' => (string)$translationElement->target,
-                                                       );
-                                               } else {
-                                                               // No target element => not yet translated
-                                                       $parsedData[(string)$translationElement['id']][0] = array(
-                                                               'source' => (string)$translationElement->source,
-                                                               'target' => (string)$translationElement->source,
-                                                       );
-                                               }
+                                               $parsedData[(string)$translationElement['id']][0] = array(
+                                                       'source' => (string)$translationElement->source,
+                                                       'target' => (string)$translationElement->target,
+                                               );
                                        }
                                } elseif ($translationElement->getName() === 'group' && isset($translationElement['restype']) && (string)$translationElement['restype'] === 'x-gettext-plurals') {
                                                // This is a translation with plural forms
@@ -87,18 +79,10 @@ class t3lib_l10n_parser_Xliff extends t3lib_l10n_parser_AbstractXml {
                                                                );
                                                        } else {
                                                                        // @todo Support "approved" attribute
-                                                               if (!empty($translationPluralForm->target)) {
-                                                                       $parsedTranslationElement[(int)$formIndex] = array(
-                                                                               'source' => (string)$translationPluralForm->source,
-                                                                               'target' => (string)$translationPluralForm->target,
-                                                                       );
-                                                               } else {
-                                                                               // No target element => not yet translated
-                                                                       $parsedTranslationElement[(int)$formIndex] = array(
-                                                                               'source' => (string)$translationPluralForm->source,
-                                                                               'target' => (string)$translationPluralForm->source,
-                                                                       );
-                                                               }
+                                                               $parsedTranslationElement[(int)$formIndex] = array(
+                                                                       'source' => (string)$translationPluralForm->source,
+                                                                       'target' => (string)$translationPluralForm->target,
+                                                               );
                                                        }
                                                }
                                        }