[wesnoth-commits] [wesnoth/wesnoth] 7b7b74: don't use std::pair

GitHub noreply at github.com
Wed Jul 18 22:49:38 UTC 2018


  Branch: refs/heads/1.14
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 7b7b7400c1c41d2294d971bbc056f55835e38234
      https://github.com/wesnoth/wesnoth/commit/7b7b7400c1c41d2294d971bbc056f55835e38234
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2018-07-19 (Thu, 19 Jul 2018)

  Changed paths:
    M src/server/simple_wml.cpp
    M src/server/simple_wml.hpp

  Log Message:
  -----------
  don't use std::pair

instead we use a custom struct. std::pair is bad becasue you never know
what "first" or "second" mean.


  Commit: 20128ac9914c971d759399dff6f7ed8edcb960c8
      https://github.com/wesnoth/wesnoth/commit/20128ac9914c971d759399dff6f7ed8edcb960c8
  Author: gfgtdf <f492343 at rmqkr.net>
  Date:   2018-07-19 (Thu, 19 Jul 2018)

  Changed paths:
    M src/server/simple_wml.cpp
    M src/server/simple_wml.hpp

  Log Message:
  -----------
  preserve traslatable strings in simple_wml.

previously it would happen that for example an attribute like
`side_name=_"female^Footpads"` in side would get its translatable mark (_)
removed after the game has started. This meant that observers that enterd
the game after it started would see the literal string "female^Footpads"
in the status side overview window.

The new code marks all translatable simple_wml attributes to make sure their
translatable mark is preserved along with their textdomain. It can still
happen though that attributes will appear in the the wrong textdomain area
after simple_wml processing though because in some cases note::output
might skip over textdomain markers. It is still not as bad as string like
"female^Footpads" appearing in the ui though.

An alterntive appraoch to fix this issue would be to carefully make sure
not to change any atributes of wml tags that can also contain translatable
attributes, which would probably imply not editing the wml objects received
by the client at all and instead storing the new information (in particular
side information like is_local=yes/no) in a seperate wml object. (that would
then be sended to the clients along with the original scenario wml objects.)

fixes #1420


Compare: https://github.com/wesnoth/wesnoth/compare/a21c4d7ce3d2...20128ac9914c
      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the Commits mailing list