Opened 8 years ago
Last modified 5 years ago
#3972 new defect
Tooltips and loading screen tips should not hardcode the numbers but use sprintf
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Must Have | Milestone: | Backlog |
Component: | Internationalization & Localization | Keywords: | |
Cc: | Patch: |
Description (last modified by )
#3904 is one of many examples of tooltips being wrong due to hardcoded numbers being present in translated strings, which are often not updated when the balancing is changed.
Besides being wrong often, it also adds pointless overhead when doing balancing or translations.
Instead it should access the template data directly and fill in the numbers using sprintf
.
The loading screen tips can be found in binaries/data/mods/public/gui/text/tips/
. Maybe these numbers could just be removed in the first place.
Change History (2)
comment:2 by , 5 years ago
Description: | modified (diff) |
---|
Number format convention changes as proposed in D1806 might be another use case for using sprintf to insert numbers into descriptions, if that's feasible.
IIRC we removed most but not all loading screen hardcoded numbers.
Loading screen tooltips already have a fixed format:
- first line caption
- other lines content
As of r22137, loading screen tooltips also assume one line per item. Phab:D1377 discusses XML and JSON as alternatives over txt. Adding sprintf support doesn't sound so far fetched.
A general consideration: For tooltips, a reference to the template attributes is probably sufficient, as they are closely linked to the implementation of the tech/entity.
For the loading screen texts the situation seems more tricky, as they tend to describe a unit in detail, quoting http://svn.wildfiregames.com/public/ps/trunk/binaries/data/mods/public/gui/text/tips/pericles.txt
This does not easily map to some template attribute. Approaches to validate such texts might include:
Edit: Fixed typo