Spaces in attack box disappear

Bug #1413226 reported by wl-zocker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Undecided
Unassigned

Bug Description

Discovered in r7363:
When you open the attack box, there are spaces between the number of soldiers and the slash. When you change the number (either by sliding the slider or by clicking on a number), the spaces disappear. See attached screenshot for clarification.

Tags: ui

Related branches

Revision history for this message
wl-zocker (wl-zocker) wrote :
Revision history for this message
GunChleoc (gunchleoc) wrote :

I can't reproduce this on a debug build, Ubuntu 14.04.

Changed in widelands:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for widelands because there has been no activity for 60 days.]

Changed in widelands:
status: Incomplete → Expired
Revision history for this message
SirVer (sirver) wrote :

Cannot repro. Is this still a thing?

Changed in widelands:
status: Expired → Invalid
Revision history for this message
wl-zocker (wl-zocker) wrote :

I still have this issues on different OS:
- r7434 on Win7, from Tino's page (release)
- r7431 on Ubuntu 14.04, from the daily ppa (release)
- r7434 on Ubuntu 14.04, self-compiled from scratch (debug)

Any idea what it might depend on?

Changed in widelands:
status: Invalid → Incomplete
Revision history for this message
SirVer (sirver) wrote :

Maybe a translations issue? Have you tried other locales?

Revision history for this message
wl-zocker (wl-zocker) wrote :

It was indeed a problem with the German translation; I fixed it. The string is not translatable before update_attack is called. I think it should be fixed for consistency.

Revision history for this message
SirVer (sirver) wrote :

Is there a gettext _() missing somewhere? Do you know where exactly in the code?

Revision history for this message
wl-zocker (wl-zocker) wrote :

here: http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/wui/attack_box.cc#L122

The update function:
m_text_soldiers->set_text((boost::format(_("%1% / %2%")) % m_slider_soldiers->get_value() % max_attackers).str());

The initialization:
sprintf(buf, "%u / %u", max_attackers > 0 ? 1 : 0, max_attackers);

Simply adding an underscore would create a new/different translation, so a replacement is needed (I do not know the difference/which one should be preferred).

Revision history for this message
GunChleoc (gunchleoc) wrote :

Do the initialization with:

(boost::format(_("%1% / %2%")) % max_attackers > 0 ? 1 : 0 % max_attackers).str()

Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
Revision history for this message
GunChleoc (gunchleoc) wrote :

Merge request sent. Thanks for tracking this one down!

Changed in widelands:
milestone: none → build19-rc1
status: Incomplete → In Progress
Revision history for this message
wl-zocker (wl-zocker) wrote :

This is fix committed now, isn't it?

Revision history for this message
GunChleoc (gunchleoc) wrote :

Yes it is - forgot to change the bug status.

Changed in widelands:
status: In Progress → Fix Committed
GunChleoc (gunchleoc)
Changed in widelands:
assignee: GunChleoc (gunchleoc) → nobody
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.