Author: sveinung Date: Fri Apr 28 12:03:03 2017 New Revision: 35317 URL: http://svn.gna.org/viewcvs/freeciv?rev=35317&view=rev Log: Rewrite building action auto help texts.
Drop act_tgt_city_range_building(). Inline the target city range description texts where they are used. Rewrite the descriptions that sounds unnatural. See hrm Feature #655512 Modified: trunk/client/helpdata.c Modified: trunk/client/helpdata.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=35317&r1=35316&r2=35317&view=diff ============================================================================== --- trunk/client/helpdata.c (original) +++ trunk/client/helpdata.c Fri Apr 28 12:03:03 2017 @@ -358,55 +358,6 @@ } log_error("Unknown directive '$%s' in help", name); return FALSE; -} - -/************************************************************************** - Returns a text describing the action target cities in range of a building - requirement. -**************************************************************************/ -static const char *act_tgt_city_range_building(const enum req_range range) -{ - fc_assert(req_range_is_valid(range)); - - switch (range) { - case REQ_RANGE_LOCAL: - /* TRANS: used as part of sentence about a building action pair. - * "it" is a building (/wonder) */ - return _("the city building it"); - case REQ_RANGE_CITY: - /* TRANS: used as part of sentence about a building action pair. - * "it" is a building (/wonder) */ - return _("its city"); - case REQ_RANGE_TRADEROUTE: - /* TRANS: used as part of sentence about a building action pair. - * "it" is a building (/wonder) */ - return _("its city and its trade partners"); - case REQ_RANGE_CONTINENT: - /* TRANS: used as part of sentence about a building action pair. - * "it" is a building (/wonder) */ - return _("all cities with its owner on its continent"); - case REQ_RANGE_PLAYER: - /* TRANS: used as part of sentence about a building action pair. - * "it" is a building (/wonder) */ - return _("all cities with its owner"); - case REQ_RANGE_TEAM: - /* TRANS: used as part of sentence about a building action pair. */ - return _("all cities on the same team"); - case REQ_RANGE_ALLIANCE: - /* TRANS: used as part of sentence about a building action pair. */ - return _("all allied cities"); - case REQ_RANGE_WORLD: - /* TRANS: used as part of sentence about a building action pair. */ - return _("all cities"); - case REQ_RANGE_CADJACENT: - case REQ_RANGE_ADJACENT: - case REQ_RANGE_COUNT: - log_error("The range %s is invalid for buildings.", - req_range_name(range)); - break; - } - - return NULL; } /**************************************************************************** @@ -1288,14 +1239,86 @@ } action_enabler_list_iterate_end; if (demanded) { - /* At least one action enabler needed the building in its target - * requirements. */ - cat_snprintf(buf, bufsz, - /* TRANS: the city building it ... Help build Wonder */ - _("* Makes it possible to target %s with the action " - "\'%s\'.\n"), - act_tgt_city_range_building(max_range), - action_id_name_translation(act)); + switch (max_range) { + case REQ_RANGE_LOCAL: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target the city building it " + "with the action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_CITY: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target its city with the " + "action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_TRADEROUTE: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target its city and its " + "trade partners with the action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_CONTINENT: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target all cities with its " + "owner on its continent with the action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_PLAYER: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target all cities with its " + "owner with the action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_TEAM: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target all cities on the " + "same team with the action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_ALLIANCE: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target all cities owned by " + "or allied to its owner with the action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_WORLD: + /* At least one action enabler needed the building in its target + * requirements. */ + cat_snprintf(buf, bufsz, + /* TRANS: Help build Wonder */ + _("* Makes it possible to target all cities with the " + "action \'%s\'.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_CADJACENT: + case REQ_RANGE_ADJACENT: + case REQ_RANGE_COUNT: + log_error("The range %s is invalid for buildings.", + req_range_name(max_range)); + break; + } } } action_iterate_end; @@ -1354,12 +1377,70 @@ } action_enabler_list_iterate_end; if (!vulnerable) { - cat_snprintf(buf, bufsz, - /* TRANS: Incite City ... all cities with its owner */ - _("* Makes it impossible to do the action \'%s\' to " - "%s.\n"), - action_id_name_translation(act), - act_tgt_city_range_building(min_range)); + switch (min_range) { + case REQ_RANGE_LOCAL: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "the city building it.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_CITY: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "its city.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_TRADEROUTE: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "its city or to its city's trade partners.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_CONTINENT: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "any city with its owner on its continent.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_PLAYER: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "any city with its owner.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_TEAM: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "any city on the same team.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_ALLIANCE: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "any city allied to or owned by its owner.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_WORLD: + cat_snprintf(buf, bufsz, + /* TRANS: Incite City */ + _("* Makes it impossible to do the action \'%s\' to " + "any city in the game.\n"), + action_id_name_translation(act)); + break; + case REQ_RANGE_CADJACENT: + case REQ_RANGE_ADJACENT: + case REQ_RANGE_COUNT: + log_error("The range %s is invalid for buildings.", + req_range_name(min_range)); + break; + } } } action_iterate_end; _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits