Code review comment for lp:~widelands-dev/widelands/economy-target-profiles

Revision history for this message
GunChleoc (gunchleoc) wrote :

Yep, translating the empty string is a bad idea.

Dropdowns, table and listselect entries have 2 data elements - one is the actual data (Entry value), the other one is a translatable label (const std::string& name). You need to compare the actual data, not the translatable label.

 void add(const std::string& name,
          Entry value,
          const Image* pic = nullptr,
          const bool select_this = false,
          const std::string& tooltip_text = std::string()) {
  entry_cache_.push_back(std::unique_ptr<Entry>(new Entry(value)));
  BaseDropdown::add(name, size(), pic, select_this, tooltip_text);
 }

« Back to merge proposal