Replace newlines with \N when modifying text via the translation assistant. Updates #1414.

Originally committed to SVN as r6485.
This commit is contained in:
Thomas Goyne 2012-02-18 00:41:08 +00:00
parent b1930f06e5
commit 7f513e675d

View file

@ -239,7 +239,11 @@ void DialogTranslation::UpdateDisplay() {
}
void DialogTranslation::Commit(bool next) {
*active_line->Blocks[cur_block] = AssDialogueBlockPlain(translated_text->GetValue());
wxString new_value = translated_text->GetValue();
new_value.Replace("\r\n", "\\N");
new_value.Replace("\r", "\\N");
new_value.Replace("\n", "\\N");
*active_line->Blocks[cur_block] = AssDialogueBlockPlain(new_value);
active_line->UpdateText();
c->ass->Commit(_("translation assistant"), AssFile::COMMIT_DIAG_TEXT);