#3979 closed enhancement (fixed)
[PATCH] Use actual playername in singleplayer instead of "You"
Reported by: | elexis | Owned by: | elexis |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 21 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
r18161 caused multiple translation issues reported on transifex: https://www.transifex.com/wildfire-games/0ad/translate/#de/public-gui-ingame/84278016
After a short discussion with leper we thought it might be a good idea to not use "You" as the playername in singleplayermode but to let the user chose one.
The attached patch differentiates between single- and multiplayer playername and allows editing them in the options. If the name is blanked, it will resort to the current username of the operating system.
Attachments (1)
Change History (6)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Furthermore if the user saves an empty string to the options field and starts a game, it will throw the following options error which is corrected by the defaulting mechanism afterwards:
ERROR: Encountered config setting 'playername.multiplayer' without value while parsing 'config/user.cfg' on line 13
by , 8 years ago
Attachment: | t3979_no_you_dont_v1.patch added |
---|
comment:4 by , 8 years ago
Keywords: | review removed |
---|
- Patch was proposed and reviewed by leper, discussed with sanderd17 and kind of approved by mimo and echotangoecho.
- A bad translation by itself wouldn't be a sufficient reason to commit this IMO.
- But the patch makes sharing singleplayer replays more effective as it lists an actual playername in the replay menu instead of "You" everywhere.
- Though not strictly required, it uses a different name in SP and MP, as suggested by leper (on irc 2016-05-13 13:40 UTC).
- Notice old configs will keep the old "playername" entry and add "playername.singleplayer" and "playername.multiplayer":
playername = "elexis3" playername.multiplayer = "elexis" playername.singleplayer = "elexis"
Both ways of deleting the old one (whitelist (keeping only valid config entries) and blacklist (deleting invalid entries)) seem wrong as one wouldn't be able to reuse the config file with previous (and potentially future) alphas anymore.
comment:5 by , 8 years ago
As noted by Yves it also solves some translation issues with the stuff AI sends:
markForTranslation("Here is a gift for %(_player_)s, make a good use of it."); markForTranslation("I see you are in a bad situation %(_player_)s, I hope this will help."); markForTranslation("I can help you this time %(_player_)s, but try to assemble more resources in the future.");
If the user saves the settings with a blank playername, it will replace that with the system name on the first gamestart.
It would be better if the name would be replaced right after saving or accepting the options.
It looks like there is no place that actually verifies options.
Currently
options.js
does no sanity checks at all. Therefore not sure if it would be nice to start doing logic there. Maybe better too many than too few safety checks.