diff --git a/src/add-ons/locale/catalogs/plaintext/Catalog.cpp b/src/add-ons/locale/catalogs/plaintext/Catalog.cpp index b09b8f6c9d..646ff354af 100644 --- a/src/add-ons/locale/catalogs/plaintext/Catalog.cpp +++ b/src/add-ons/locale/catalogs/plaintext/Catalog.cpp @@ -319,18 +319,23 @@ PlainTextCatalog::WriteToFile(const char *path) CatMap::Iterator iter = fCatMap.GetIterator(); CatMap::Entry entry; BString original; + BString comment; BString translated; while (iter.HasNext()) { entry = iter.Next(); original = entry.key.fString; + comment = entry.key.fComment; translated = entry.value; + escapeQuotedChars(original); + escapeQuotedChars(comment); escapeQuotedChars(translated); + textContent.Truncate(0); textContent << original.String() << "\t" << entry.key.fContext.String() << "\t" - << entry.key.fComment.String() << "\t" + << comment << "\t" << translated.String() << "\n"; res = catalogFile.Write(textContent.String(),textContent.Length()); if (res != textContent.Length()) diff --git a/src/tools/locale/PlainTextCatalog.cpp b/src/tools/locale/PlainTextCatalog.cpp index 43d87128f0..71e35bb3f9 100644 --- a/src/tools/locale/PlainTextCatalog.cpp +++ b/src/tools/locale/PlainTextCatalog.cpp @@ -275,18 +275,23 @@ PlainTextCatalog::WriteToFile(const char *path) CatMap::Iterator iter = fCatMap.GetIterator(); CatMap::Entry entry; BString original; + BString comment; BString translated; while (iter.HasNext()) { entry = iter.Next(); original = entry.key.fString; + comment = entry.key.fComment; translated = entry.value; + escapeQuotedChars(original); + escapeQuotedChars(comment); escapeQuotedChars(translated); + textContent.Truncate(0); textContent << original.String() << "\t" << entry.key.fContext.String() << "\t" - << entry.key.fComment.String() << "\t" + << comment << "\t" << translated.String() << "\n"; res = catalogFile.Write(textContent.String(),textContent.Length()); if (res != textContent.Length())