diff --git a/translators/tmgmt_file/src/FileTranslatorUi.php b/translators/tmgmt_file/src/FileTranslatorUi.php index 8b41fc3..43b6914 100644 --- a/translators/tmgmt_file/src/FileTranslatorUi.php +++ b/translators/tmgmt_file/src/FileTranslatorUi.php @@ -34,13 +34,6 @@ class FileTranslatorUi extends TranslatorPluginUiBase { '#description' => t('Please select the format you want to export data.'), ); - $form['xliff_processing'] = array( - '#type' => 'checkbox', - '#title' => t('Extended XLIFF processing'), - '#description' => t('Check to further process content semantics and mask HTML tags instead just escaping it.'), - '#default_value' => $translator->getSetting('xliff_processing'), - ); - $form['xliff_cdata'] = array( '#type' => 'checkbox', '#title' => t('XLIFF CDATA'), @@ -48,6 +41,13 @@ class FileTranslatorUi extends TranslatorPluginUiBase { '#default_value' => $translator->getSetting('xliff_cdata'), ); + $form['xliff_processing'] = array( + '#type' => 'checkbox', + '#title' => t('Extended XLIFF processing'), + '#description' => t('Check to further process content semantics and mask HTML tags instead just escaping it.'), + '#default_value' => $translator->getSetting('xliff_processing'), + ); + $form['xliff_message'] = array( '#type' => 'container', '#markup' => t('By selecting CDATA option, XLIFF processing will be ignored.'), diff --git a/translators/tmgmt_file/src/Plugin/tmgmt_file/Format/Xliff.php b/translators/tmgmt_file/src/Plugin/tmgmt_file/Format/Xliff.php index 9067005..48d76db 100644 --- a/translators/tmgmt_file/src/Plugin/tmgmt_file/Format/Xliff.php +++ b/translators/tmgmt_file/src/Plugin/tmgmt_file/Format/Xliff.php @@ -116,12 +116,12 @@ class Xliff extends \XMLWriter implements FormatInterface { $this->startElement('source'); $this->writeAttribute('xml:lang', $this->job->getRemoteSourceLanguage()); - if ($job->getSetting('xliff_processing')) { - $this->writeRaw($this->processForExport($element['#text'], $key_array)); - } - elseif ($job->getSetting('xliff_cdata')) { + if ($job->getSetting('xliff_cdata')) { $this->writeCdata(trim($element['#text'])); } + elseif ($job->getSetting('xliff_processing')) { + $this->writeRaw($this->processForExport($element['#text'], $key_array)); + } else { $this->text($element['#text']); }