widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #07082
[Merge] lp:~widelands-dev/widelands/escaping-fixes into lp:widelands
Miroslav Remák has proposed merging lp:~widelands-dev/widelands/escaping-fixes into lp:widelands.
Commit message:
- Remove unnecessary code
- Unescape several plaintext strings
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/escaping-fixes/+merge/290821
About the unescape change: with & -> & replacement in place, < and > will no longer be replaced in plaintext strings (prevented in MultilineTextarea::make_richtext). This fixes '<parent>' showing up literally after my latest escaping changes.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/escaping-fixes into lp:widelands.
=== modified file 'src/graphic/text_parser.cc'
--- src/graphic/text_parser.cc 2016-03-30 08:38:59 +0000
+++ src/graphic/text_parser.cc 2016-04-03 13:24:21 +0000
@@ -125,16 +125,6 @@
line = i18n::make_ligatures(line.c_str());
std::string::size_type next_break = line.find("<br>");
- // Replace < with <
- std::string::size_type smaller = line.find("<");
- while (smaller != std::string::npos) {
- line.replace(smaller, 4, "<");
- if (next_break > smaller)
- // Fix position of <br> tag
- next_break -= 3;
- smaller = line.find("<");
- }
-
if (next_break == std::string::npos) {
if (line.size()) {
std::string word = line;
=== modified file 'src/network/internet_gaming.cc'
--- src/network/internet_gaming.cc 2016-03-28 10:37:09 +0000
+++ src/network/internet_gaming.cc 2016-04-03 13:24:21 +0000
@@ -854,7 +854,7 @@
ChatMessage c;
if (!system && from.empty()) {
std::string unkown_string =
- (boost::format("<%s>") % _("unknown")).str();
+ (boost::format("<%s>") % _("unknown")).str();
c.sender = unkown_string;
} else {
c.sender = from;
=== modified file 'src/ui_fsmenu/launch_mpg.cc'
--- src/ui_fsmenu/launch_mpg.cc 2016-04-01 17:59:00 +0000
+++ src/ui_fsmenu/launch_mpg.cc 2016-04-03 13:24:21 +0000
@@ -581,7 +581,7 @@
infotext += (boost::format(_("Player %u")) % static_cast<unsigned int>(i)).str();
if (player_save_tribe[i - 1].empty()) {
std::string closed_string =
- (boost::format("<%s>") % _("closed")).str();
+ (boost::format("<%s>") % _("closed")).str();
infotext += ":\n ";
infotext += closed_string;
// Close the player
=== modified file 'src/wui/mapdata.cc'
--- src/wui/mapdata.cc 2016-03-29 18:34:26 +0000
+++ src/wui/mapdata.cc 2016-04-03 13:24:21 +0000
@@ -126,7 +126,7 @@
// static
std::string MapData::parent_name() {
/** TRANSLATORS: Parent directory/folder */
- return (boost::format("<%s>") % _("parent")).str();
+ return (boost::format("<%s>") % _("parent")).str();
}
// static
=== modified file 'src/wui/multiplayersetupgroup.cc'
--- src/wui/multiplayersetupgroup.cc 2016-03-29 08:29:31 +0000
+++ src/wui/multiplayersetupgroup.cc 2016-04-03 13:24:21 +0000
@@ -124,7 +124,7 @@
void refresh() {
UserSettings us = s->settings().users.at(id_);
if (us.position == UserSettings::not_connected()) {
- name->set_text((boost::format("<%s>") % _("free")).str());
+ name->set_text((boost::format("<%s>") % _("free")).str());
if (type)
type->set_visible(false);
else
Follow ups