From fa8a73b3bc9cb25f5bdce05fe7ec4216c1df97f8 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 1 Apr 2024 21:48:38 +0300 Subject: [PATCH 39/39] Mark rssanity.c error messages for translation See osdn #48803 Signed-off-by: Marko Lindqvist --- server/rssanity.c | 278 ++++++++++++++++++++++++---------------------- 1 file changed, 143 insertions(+), 135 deletions(-) diff --git a/server/rssanity.c b/server/rssanity.c index bfb1e491c6..aceef4dc09 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -61,8 +61,9 @@ static bool sanity_check_metadata(rs_conversion_logger logger) if (game.ruleset_summary != NULL && strlen(game.ruleset_summary) > MAX_LEN_CONTENT) { ruleset_error(logger, - LOG_ERROR, "Too long ruleset summary. It can be only %d bytes long. " - "Put longer explanations to ruleset description.", + LOG_ERROR, + _("Too long ruleset summary. It can be only %d bytes long. " + "Put longer explanations to ruleset description."), MAX_LEN_CONTENT); return FALSE; } @@ -179,14 +180,14 @@ static bool sanity_check_req_individual(rs_conversion_logger logger, if (preq->range == REQ_RANGE_WORLD && !is_great_wonder(pimprove)) { ruleset_error(logger, LOG_ERROR, - "%s: World-ranged requirement not supported for " - "%s (only great wonders supported)", list_for, + _("%s: World-ranged requirement not supported for " + "%s (only great wonders supported)"), list_for, improvement_name_translation(pimprove)); return FALSE; } else if (preq->range > REQ_RANGE_TRADE_ROUTE && !is_wonder(pimprove)) { ruleset_error(logger, LOG_ERROR, - "%s: %s-ranged requirement not supported for " - "%s (only wonders supported)", list_for, + _("%s: %s-ranged requirement not supported for " + "%s (only wonders supported)"), list_for, req_range_name(preq->range), improvement_name_translation(pimprove)); return FALSE; @@ -198,13 +199,13 @@ static bool sanity_check_req_individual(rs_conversion_logger logger, * parsed, so we can't do this in universal_value_from_str(). */ if (game.calendar.calendar_fragments < 1) { ruleset_error(logger, LOG_ERROR, - "%s: MinCalFrag requirement used in ruleset without " - "calendar fragments", list_for); + _("%s: MinCalFrag requirement used in ruleset without " + "calendar fragments"), list_for); return FALSE; } else if (preq->source.value.mincalfrag >= game.calendar.calendar_fragments) { ruleset_error(logger, LOG_ERROR, - "%s: MinCalFrag requirement %d out of range (max %d in " - "this ruleset)", list_for, preq->source.value.mincalfrag, + _("%s: MinCalFrag requirement %d out of range (max %d in " + "this ruleset)"), list_for, preq->source.value.mincalfrag, game.calendar.calendar_fragments-1); return FALSE; } @@ -222,10 +223,10 @@ static bool sanity_check_req_individual(rs_conversion_logger logger, if (!sanity_check_setting_is_seen(pset)) { ruleset_error(logger, LOG_ERROR, - "%s: ServerSetting requirement %s isn't visible enough " - "to appear in a requirement. Everyone should be able to " - "see the value of a server setting that appears in a " - "requirement.", list_for, server_setting_name_get(id)); + _("%s: ServerSetting requirement %s isn't visible enough " + "to appear in a requirement. Everyone should be able to " + "see the value of a server setting that appears in a " + "requirement."), list_for, server_setting_name_get(id)); return FALSE; } @@ -233,8 +234,8 @@ static bool sanity_check_req_individual(rs_conversion_logger logger, /* This is a server operator related setting (like the compression * type of savegames), not a game rule. */ ruleset_error(logger, LOG_ERROR, - "%s: ServerSetting requirement setting %s isn't about a " - "game rule.", + _("%s: ServerSetting requirement setting %s isn't about a " + "game rule."), list_for, server_setting_name_get(id)); return FALSE; } @@ -285,8 +286,8 @@ static bool sanity_check_req_set(rs_conversion_logger logger, case VUT_EXTRA: if (local_reqs_of_type[VUT_EXTRA] > 1) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has multiple local-ranged extra " - "requirements (did you mean to make them tile-ranged?)", + _("%s: Requirement list has multiple local-ranged extra " + "requirements (did you mean to make them tile-ranged?)"), list_for); return FALSE; } @@ -303,7 +304,7 @@ static bool sanity_check_req_set(rs_conversion_logger logger, case VUT_TERRAINCLASS: if (tile_reqs_of_type[VUT_TERRAIN] > 0) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has both tile terrain and terrainclass requirement", + _("%s: Requirement list has both tile terrain and terrainclass requirement"), list_for); return FALSE; } @@ -311,7 +312,7 @@ static bool sanity_check_req_set(rs_conversion_logger logger, case VUT_TERRAIN: if (tile_reqs_of_type[VUT_TERRAINCLASS] > 0) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has both tile terrain and terrainclass requirement", + _("%s: Requirement list has both tile terrain and terrainclass requirement"), list_for); return FALSE; } @@ -320,7 +321,7 @@ static bool sanity_check_req_set(rs_conversion_logger logger, case VUT_MAXLATITUDE: if (tile_reqs_of_type[preq->range] > 1) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has duplicate %s requirement at Tile range", + _("%s: Requirement list has duplicate %s requirement at Tile range"), list_for, universal_type_rule_name(&preq->source)); return FALSE; } @@ -359,7 +360,7 @@ static bool sanity_check_req_set(rs_conversion_logger logger, * declarations error anyway. */ ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has multiple %s requirements", + _("%s: Requirement list has multiple %s requirements"), list_for, universal_type_rule_name(&preq->source)); return FALSE; break; @@ -368,8 +369,8 @@ static bool sanity_check_req_set(rs_conversion_logger logger, /* There can be only up to max_tiles requirements of these types */ if (max_tiles != -1 && rc > max_tiles) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has more %s requirements than " - "can ever be fulfilled.", list_for, + _("%s: Requirement list has more %s requirements than " + "can ever be fulfilled."), list_for, universal_type_rule_name(&preq->source)); return FALSE; } @@ -378,8 +379,8 @@ static bool sanity_check_req_set(rs_conversion_logger logger, case VUT_TERRAINCLASS: if (rc > 2 || (max_tiles != -1 && rc > max_tiles)) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has more %s requirements than " - "can ever be fulfilled.", list_for, + _("%s: Requirement list has more %s requirements than " + "can ever be fulfilled."), list_for, universal_type_rule_name(&preq->source)); return FALSE; } @@ -389,8 +390,8 @@ static bool sanity_check_req_set(rs_conversion_logger logger, /* There can be age of the city, unit, and player */ if (rc > 3) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has more %s requirements than " - "can ever be fulfilled.", list_for, + _("%s: Requirement list has more %s requirements than " + "can ever be fulfilled."), list_for, universal_type_rule_name(&preq->source)); return FALSE; } @@ -400,8 +401,8 @@ static bool sanity_check_req_set(rs_conversion_logger logger, /* At ranges 'Player' and 'World' */ if (rc > 2) { ruleset_error(logger, LOG_ERROR, - "%s: Requirement list has more %s requirements than " - "can ever be fulfilled.", list_for, + _("%s: Requirement list has more %s requirements than " + "can ever be fulfilled."), list_for, universal_type_rule_name(&preq->source)); return FALSE; } @@ -561,9 +562,9 @@ static bool effect_list_sanity_cb(struct effect *peffect, void *data) * action_consequence_success() does) or to have the unit stack * targeted actions return a list of targets. */ ruleset_error(els->logger, LOG_ERROR, - "The effect Action_Success_Target_Move_Cost has the" - " requirement {%s} but the action %s isn't" - " (single) unit targeted.", + _("The effect Action_Success_Target_Move_Cost has the" + " requirement {%s} but the action %s isn't" + " (single) unit targeted."), req_to_fstring(preq, &astr), universal_rule_name(&preq->source)); astr_free(&astr); @@ -577,9 +578,9 @@ static bool effect_list_sanity_cb(struct effect *peffect, void *data) if (preq->source.kind == VUT_ACTION && preq->present) { if (action_get_actor_kind(preq->source.value.action) != AAK_UNIT) { ruleset_error(els->logger, LOG_ERROR, - "The effect Action_Success_Actor_Move_Cost has the" - " requirement {%s} but the action %s isn't" - " performed by a unit.", + _("The effect Action_Success_Actor_Move_Cost has the" + " requirement {%s} but the action %s isn't" + " performed by a unit."), req_to_fstring(preq, &astr), universal_rule_name(&preq->source)); astr_free(&astr); @@ -595,9 +596,9 @@ static bool effect_list_sanity_cb(struct effect *peffect, void *data) if (action_dice_roll_initial_odds(preq->source.value.action) == ACTION_ODDS_PCT_DICE_ROLL_NA) { ruleset_error(els->logger, LOG_ERROR, - "The effect %s has the" - " requirement {%s} but the action %s doesn't" - " roll the dice to see if it fails.", + _("The effect %s has the" + " requirement {%s} but the action %s doesn't" + " roll the dice to see if it fails."), effect_type_name(peffect->type), req_to_fstring(preq, &astr), universal_rule_name(&preq->source)); @@ -611,7 +612,7 @@ static bool effect_list_sanity_cb(struct effect *peffect, void *data) if (!sanity_check_req_vec(els->logger, &peffect->reqs, TRUE, one_tile, effect_type_name(peffect->type))) { ruleset_error(els->logger, LOG_ERROR, - "Effects have conflicting or invalid requirements!"); + _("Effects have conflicting or invalid requirements!")); return FALSE; } @@ -626,15 +627,15 @@ static bool rs_barbarian_units(rs_conversion_logger logger) { if (num_role_units(L_BARBARIAN) > 0) { if (num_role_units(L_BARBARIAN_LEADER) == 0) { - ruleset_error(logger, LOG_ERROR, "No role barbarian leader units"); + ruleset_error(logger, LOG_ERROR, _("No role barbarian leader units")); return FALSE; } if (num_role_units(L_BARBARIAN_BUILD) == 0) { - ruleset_error(logger, LOG_ERROR, "No role barbarian build units"); + ruleset_error(logger, LOG_ERROR, _("No role barbarian build units")); return FALSE; } if (num_role_units(L_BARBARIAN_BOAT) == 0) { - ruleset_error(logger, LOG_ERROR, "No role barbarian ship units"); + ruleset_error(logger, LOG_ERROR, _("No role barbarian ship units")); return FALSE; } else if (num_role_units(L_BARBARIAN_BOAT) > 0) { bool sea_capable = FALSE; @@ -650,13 +651,13 @@ static bool rs_barbarian_units(rs_conversion_logger logger) if (!sea_capable) { ruleset_error(logger, LOG_ERROR, - "Barbarian boat (%s) needs to be able to move at sea.", + _("Barbarian boat (%s) needs to be able to move at sea."), utype_rule_name(u)); return FALSE; } } if (num_role_units(L_BARBARIAN_SEA) == 0) { - ruleset_error(logger, LOG_ERROR, "No role sea raider barbarian units"); + ruleset_error(logger, LOG_ERROR, _("No role sea raider barbarian units")); return FALSE; } @@ -664,8 +665,8 @@ static bool rs_barbarian_units(rs_conversion_logger logger) if (utype_has_role(ptype, L_BARBARIAN_BOAT)) { if (ptype->transport_capacity <= 1) { ruleset_error(logger, LOG_ERROR, - "Barbarian boat %s has no capacity for both " - "leader and at least one man.", + _("Barbarian boat %s has no capacity for both " + "leader and at least one man."), utype_rule_name(ptype)); return FALSE; } @@ -676,8 +677,8 @@ static bool rs_barbarian_units(rs_conversion_logger logger) || utype_has_role(pbarb, L_BARBARIAN_LEADER)) { if (!can_unit_type_transport(ptype, utype_class(pbarb))) { ruleset_error(logger, LOG_ERROR, - "Barbarian boat %s cannot transport " - "barbarian cargo %s.", + _("Barbarian boat %s cannot transport " + "barbarian cargo %s."), utype_rule_name(ptype), utype_rule_name(pbarb)); return FALSE; @@ -698,19 +699,19 @@ static bool rs_common_units(rs_conversion_logger logger) { /* Check some required flags and roles etc: */ if (num_role_units(UTYF_SETTLERS) == 0) { - ruleset_error(logger, LOG_ERROR, "No flag Settler units"); + ruleset_error(logger, LOG_ERROR, _("No flag Settler units")); return FALSE; } if (num_role_units(L_START_EXPLORER) == 0) { - ruleset_error(logger, LOG_ERROR, "No role Start Explorer units"); + ruleset_error(logger, LOG_ERROR, _("No role Start Explorer units")); return FALSE; } if (num_role_units(L_FERRYBOAT) == 0) { - ruleset_error(logger, LOG_ERROR, "No role Ferryboat units"); + ruleset_error(logger, LOG_ERROR, _("No role Ferryboat units")); return FALSE; } if (num_role_units(L_FIRSTBUILD) == 0) { - ruleset_error(logger, LOG_ERROR, "No role Firstbuild units"); + ruleset_error(logger, LOG_ERROR, _("No role Firstbuild units")); return FALSE; } @@ -728,7 +729,7 @@ static bool rs_common_units(rs_conversion_logger logger) if (!sea_capable) { ruleset_error(logger, LOG_ERROR, - "Ferryboat (%s) needs to be able to move at sea.", + _("Ferryboat (%s) needs to be able to move at sea."), utype_rule_name(u)); return FALSE; } @@ -737,7 +738,8 @@ static bool rs_common_units(rs_conversion_logger logger) if (num_role_units(L_PARTISAN) == 0 && effect_cumulative_max(EFT_INSPIRE_PARTISANS, NULL, 0) > 0) { ruleset_error(logger, LOG_ERROR, - "Inspire_Partisans effect present, but no units with partisan role."); + _("Inspire_Partisans effect present, " + "but no units with partisan role.")); return FALSE; } @@ -754,7 +756,7 @@ static bool rs_buildings(rs_conversion_logger logger) if (improvement_has_flag(pimprove, IF_GOLD) && pimprove->genus != IG_CONVERT) { ruleset_error(logger, LOG_ERROR, - "Gold producing improvement %s with genus other than \"Convert\"", + _("Gold producing improvement %s with genus other than \"Convert\""), improvement_rule_name(pimprove)); return FALSE; @@ -762,7 +764,7 @@ static bool rs_buildings(rs_conversion_logger logger) if (improvement_has_flag(pimprove, IF_DISASTER_PROOF) && pimprove->genus != IG_IMPROVEMENT) { ruleset_error(logger, LOG_ERROR, - "Disasterproof improvement %s with genus other than \"Improvement\"", + _("Disasterproof improvement %s with genus other than \"Improvement\""), improvement_rule_name(pimprove)); return FALSE; @@ -775,14 +777,14 @@ static bool rs_buildings(rs_conversion_logger logger) || get_potential_improvement_bonus(pimprove, NULL, EFT_SS_MODULE, RPT_POSSIBLE, FALSE))) { ruleset_error(logger, LOG_ERROR, - "Space part %s with genus other than \"Special\"", + _("Space part %s with genus other than \"Special\""), improvement_rule_name(pimprove)); return FALSE; } if (!is_building_sellable(pimprove) && pimprove->upkeep != 0) { ruleset_error(logger, LOG_ERROR, - "%s is a nonsellable building with a nonzero upkeep value", + _("%s is a nonsellable building with a nonzero upkeep value"), improvement_rule_name(pimprove)); return FALSE; } @@ -829,8 +831,9 @@ static bool sanity_check_boolean_effects(rs_conversion_logger logger) if (effect_cumulative_min(boolean_effects[i], NULL) < 0 && effect_cumulative_max(boolean_effects[i], NULL, 0) == 0) { ruleset_error(logger, LOG_ERROR, - "Boolean effect %s can get disabled, but it can't get " - "enabled before that.", effect_type_name(boolean_effects[i])); + _("Boolean effect %s can get disabled, but it can't get " + "enabled before that."), + effect_type_name(boolean_effects[i])); ret = FALSE; } } @@ -864,8 +867,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (game.info.tech_cost_style == TECH_COST_CIV1CIV2 && game.info.free_tech_method == FTM_CHEAPEST) { ruleset_error(logger, LOG_ERROR, - "Cost based free tech method, but tech cost style " - "\"Civ I|II\" so all techs cost the same."); + _("Cost based free tech method, but tech cost style " + "\"Civ I|II\" so all techs cost the same.")); ok = FALSE; } @@ -884,7 +887,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (A_NEVER == preq) { continue; } else if (preq == padvance) { - ruleset_error(logger, LOG_ERROR, "Tech \"%s\" requires itself.", + ruleset_error(logger, LOG_ERROR, _("Tech \"%s\" requires itself."), advance_rule_name(padvance)); ok = FALSE; continue; @@ -893,7 +896,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) advance_req_iterate(preq, preqreq) { if (preqreq == padvance) { ruleset_error(logger, LOG_ERROR, - "Tech \"%s\" requires itself indirectly via \"%s\".", + _("Tech \"%s\" requires itself indirectly via \"%s\"."), advance_rule_name(padvance), advance_rule_name(preq)); ok = FALSE; @@ -907,9 +910,9 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) * expect all tech reqs to appear in the client tech tree. That * should be taken care of first. */ ruleset_error(logger, LOG_ERROR, - "Tech \"%s\" requires a tech in its research_reqs." - " This isn't supported yet. Please keep using req1" - " and req2 like before.", + _("Tech \"%s\" requires a tech in its research_reqs." + " This isn't supported yet. Please keep using req1" + " and req2 like before."), advance_rule_name(padvance)); ok = FALSE; } else if (is_req_unchanging(NULL, preq) < REQUCH_HACK @@ -922,10 +925,10 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) * can handle it and the tech tree can display changing * requirements. */ ruleset_error(logger, LOG_ERROR, - "Tech \"%s\" has the requirement %s in its" - " research_reqs. This requirement may change during" - " the game. Changing requirements aren't supported" - " yet.", + _("Tech \"%s\" has the requirement %s in its" + " research_reqs. This requirement may change during" + " the game. Changing requirements aren't supported" + " yet."), advance_rule_name(padvance), req_to_fstring(preq, &astr)); astr_free(&astr); @@ -936,7 +939,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (padvance->bonus_message != NULL) { if (!formats_match(padvance->bonus_message, "%s")) { ruleset_error(logger, LOG_ERROR, - "Tech \"%s\" bonus message is not format with %%s for a bonus tech name.", + _("Tech \"%s\" bonus message is not format with %%s " + "for a bonus tech name."), advance_rule_name(padvance)); ok = FALSE; } @@ -945,8 +949,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (game.default_government == game.government_during_revolution) { ruleset_error(logger, LOG_ERROR, - "The government form %s reserved for revolution handling has been set as " - "default_government.", + _("The government form %s reserved for revolution handling " + "has been set as default_government."), government_rule_name(game.government_during_revolution)); ok = FALSE; default_gov_failed = TRUE; @@ -964,16 +968,16 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (a == NULL) { ruleset_error(logger, LOG_ERROR, - "Tech %s does not exist, but is initial " - "tech for everyone.", + _("Tech %s does not exist, but is initial " + "tech for everyone."), advance_rule_name(advance_by_number(tech))); ok = FALSE; } else if (advance_by_number(A_NONE) != a->require[AR_ROOT] && !nation_has_initial_tech(pnation, a->require[AR_ROOT])) { /* Nation has no root_req for tech */ ruleset_error(logger, LOG_ERROR, - "Tech %s is initial for everyone, but %s has " - "no root_req for it.", + _("Tech %s is initial for everyone, but %s has " + "no root_req for it."), advance_rule_name(a), nation_rule_name(pnation)); ok = FALSE; @@ -989,7 +993,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (a == NULL) { ruleset_error(logger, LOG_ERROR, - "Tech %s does not exist, but is tech for %s.", + _("Tech %s does not exist, but is tech for %s."), advance_rule_name(advance_by_number(tech)), nation_rule_name(pnation)); ok = FALSE; @@ -997,8 +1001,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) && !nation_has_initial_tech(pnation, a->require[AR_ROOT])) { /* Nation has no root_req for tech */ ruleset_error(logger, LOG_ERROR, - "Tech %s is initial for %s, but they have " - "no root_req for it.", + _("Tech %s is initial for %s, but they have " + "no root_req for it."), advance_rule_name(a), nation_rule_name(pnation)); ok = FALSE; @@ -1009,14 +1013,14 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (nation_barbarian_type(pnation) != NOT_A_BARBARIAN && pnation->init_buildings[0] != B_LAST) { ruleset_error(logger, LOG_ERROR, - "Barbarian nation %s has init_buildings set but will " - "never see them", nation_rule_name(pnation)); + _("Barbarian nation %s has init_buildings set but will " + "never see them"), nation_rule_name(pnation)); } if (!default_gov_failed && pnation->init_government == game.government_during_revolution) { ruleset_error(logger, LOG_ERROR, - "The government form %s reserved for revolution handling has been set as " - "initial government for %s.", + _("The government form %s reserved for revolution " + "handling has been set as initial government for %s."), government_rule_name(game.government_during_revolution), nation_rule_name(pnation)); ok = FALSE; @@ -1034,8 +1038,9 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) chain_length++; if (chain_length > num_utypes) { ruleset_error(logger, LOG_ERROR, - "There seems to be obsoleted_by loop in update " - "chain that starts from %s", utype_rule_name(putype)); + _("There seems to be obsoleted_by loop in update " + "chain that starts from %s"), + utype_rule_name(putype)); ok = FALSE; obsoleted_by_loop = TRUE; } @@ -1051,8 +1056,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (utype_has_flag(putype, UTYF_SPY) && !utype_has_flag(putype, UTYF_DIPLOMAT)) { ruleset_error(logger, LOG_ERROR, - "The unit type '%s' has the 'Spy' unit type flag but " - "not the 'Diplomat' unit type flag.", + _("The unit type '%s' has the 'Spy' unit type flag but " + "not the 'Diplomat' unit type flag."), utype_rule_name(putype)); ok = FALSE; } @@ -1064,8 +1069,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) || putype->paratroopers_range > UNIT_MAX_PARADROP_RANGE) { /* Paradrop range is limited by the network protocol. */ ruleset_error(logger, LOG_ERROR, - "The paratroopers_range of the unit type '%s' is %d. " - "That is out of range. Max range is %d.", + _("The paratroopers_range of the unit type '%s' is %d. " + "That is out of range. Max range is %d."), utype_rule_name(putype), putype->paratroopers_range, UNIT_MAX_PARADROP_RANGE); ok = FALSE; @@ -1074,8 +1079,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if ((putype->city_size <= 0 || putype->city_size > MAX_CITY_SIZE) && utype_is_cityfounder(putype)) { ruleset_error(logger, LOG_ERROR, - "Unit type '%s' would build size %d cities. " - "City sizes must be from 1 to %d.", + _("Unit type '%s' would build size %d cities. " + "City sizes must be from 1 to %d."), utype_rule_name(putype), putype->city_size, MAX_CITY_SIZE); ok = FALSE; @@ -1094,7 +1099,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) for (i = 0; req_base_effects[i] != EFT_COUNT; i++) { if (!els.base_effects.effect_present[req_base_effects[i]]) { ruleset_error(logger, LOG_ERROR, - "There is no base %s effect.", + _("There is no base %s effect."), effect_type_name(req_base_effects[i])); ok = FALSE; } @@ -1113,7 +1118,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) } } else { ruleset_error(logger, LOG_ERROR, - "There is no base %s effect.", ename); + _("There is no base %s effect."), ename); ok = FALSE; } } @@ -1130,7 +1135,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!sanity_check_req_vec(logger, &pdis->reqs, TRUE, -1, disaster_rule_name(pdis))) { ruleset_error(logger, LOG_ERROR, - "Disasters have conflicting or invalid requirements!"); + _("Disasters have conflicting or invalid requirements!")); ok = FALSE; } } disaster_type_re_active_iterate_end; @@ -1140,7 +1145,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!sanity_check_req_vec(logger, &pgood->reqs, TRUE, -1, goods_rule_name(pgood))) { ruleset_error(logger, LOG_ERROR, - "Goods have conflicting or invalid requirements!"); + _("Goods have conflicting or invalid requirements!")); ok = FALSE; } } goods_type_re_active_iterate_end; @@ -1166,7 +1171,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!sanity_check_req_vec(logger, &pgov->reqs, TRUE, -1, government_rule_name(pgov))) { ruleset_error(logger, LOG_ERROR, - "Governments have conflicting or invalid requirements!"); + _("Governments have conflicting or invalid requirements!")); ok = FALSE; } } governments_re_active_iterate_end; @@ -1176,7 +1181,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!sanity_check_req_vec(logger, &psp->reqs, TRUE, -1, specialist_rule_name(psp))) { ruleset_error(logger, LOG_ERROR, - "Specialists have conflicting or invalid requirements!"); + _("Specialists have conflicting or invalid requirements!")); ok = FALSE; } } specialist_type_re_active_iterate_end; @@ -1186,21 +1191,21 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!sanity_check_req_vec(logger, &pextra->reqs, TRUE, -1, extra_rule_name(pextra))) { ruleset_error(logger, LOG_ERROR, - "Extras have conflicting or invalid requirements!"); + _("Extras have conflicting or invalid requirements!")); ok = FALSE; } if (!sanity_check_req_vec(logger, &pextra->rmreqs, TRUE, -1, extra_rule_name(pextra))) { ruleset_error(logger, LOG_ERROR, - "Extras have conflicting or invalid removal requirements!"); + _("Extras have conflicting or invalid removal requirements!")); ok = FALSE; } if ((requirement_vector_size(&pextra->rmreqs) > 0) && !(pextra->rmcauses & (ERM_ENTER | ERM_CLEAN | ERM_PILLAGE))) { ruleset_error(logger, LOG_WARN, - "Requirements for extra removal defined but not " - "a valid remove cause!"); + _("Requirements for extra removal defined but not " + "a valid remove cause!")); } } extra_type_re_active_iterate_end; @@ -1216,7 +1221,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) && !BV_ISSET(iroad->integrates, pnbr)) { /* We don't support non-symmetric integrator relationships yet. */ ruleset_error(logger, LOG_ERROR, - "Road '%s' integrates with '%s' but not vice versa!", + _("Road '%s' integrates with '%s' but not vice versa!"), extra_rule_name(pextra), extra_rule_name(iextra)); ok = FALSE; @@ -1229,7 +1234,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!sanity_check_req_vec(logger, &city_styles[i].reqs, TRUE, -1, city_style_rule_name(i))) { ruleset_error(logger, LOG_ERROR, - "City styles have conflicting or invalid requirements!"); + _("City styles have conflicting or invalid requirements!")); ok = FALSE; } } @@ -1239,22 +1244,24 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) struct action *paction = action_by_number(act); if (!actres_legal_target_kind(paction->result, paction->target_kind)) { - ruleset_error(logger, LOG_ERROR, "Action \"%s\": unsupported target kind %s.", + ruleset_error(logger, LOG_ERROR, + _("Action \"%s\": unsupported target kind %s."), action_id_rule_name(act), action_target_kind_name(paction->target_kind)); ok = FALSE; } if (paction->min_distance < 0) { - ruleset_error(logger, LOG_ERROR, "Action %s: negative min distance (%d).", + ruleset_error(logger, LOG_ERROR, + _("Action %s: negative min distance (%d)."), action_id_rule_name(act), paction->min_distance); ok = FALSE; } if (paction->min_distance > ACTION_DISTANCE_LAST_NON_SIGNAL) { ruleset_error(logger, LOG_ERROR, - "Action %s: min distance (%d) larger than " - "any distance on a map can be (%d).", + _("Action %s: min distance (%d) larger than " + "any distance on a map can be (%d)."), action_id_rule_name(act), paction->min_distance, ACTION_DISTANCE_LAST_NON_SIGNAL); ok = FALSE; @@ -1262,15 +1269,15 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (paction->max_distance > ACTION_DISTANCE_MAX) { ruleset_error(logger, LOG_ERROR, - "Action %s: max distance is %d. " - "A map can't be that big.", + _("Action %s: max distance is %d. " + "A map can't be that big."), action_id_rule_name(act), paction->max_distance); ok = FALSE; } if (!action_distance_inside_max(paction, paction->min_distance)) { ruleset_error(logger, LOG_ERROR, - "Action %s: min distance is %d but max distance is %d.", + _("Action %s: min distance is %d but max distance is %d."), action_id_rule_name(act), paction->min_distance, paction->max_distance); ok = FALSE; @@ -1284,7 +1291,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) * action against. (A tile may have more than one individual * unit) */ ruleset_error(logger, LOG_ERROR, - "The action %s can't block %s.", + _("The action %s can't block %s."), action_id_rule_name(blocker), action_id_rule_name(act)); ok = FALSE; @@ -1297,8 +1304,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) || !sanity_check_req_vec(logger, &(enabler->target_reqs), TRUE, -1, "Action Enabler Target Reqs")) { ruleset_error(logger, LOG_ERROR, - "Action enabler for %s has conflicting or invalid " - "requirements!", action_id_rule_name(act)); + _("Action enabler for %s has conflicting or invalid " + "requirements!"), action_id_rule_name(act)); ok = FALSE; } @@ -1309,8 +1316,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) /* Shouldn't have target requirements since the action doesn't * have a target. */ ruleset_error(logger, LOG_ERROR, - "An action enabler for %s has a target " - "requirement vector. %s doesn't have a target.", + _("An action enabler for %s has a target " + "requirement vector. %s doesn't have a target."), action_id_rule_name(act), action_id_rule_name(act)); ok = FALSE; @@ -1326,10 +1333,10 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) * in actor_reqs. Demand that it is there. This avoids breaking * code that reasons about actions. */ ruleset_error(logger, LOG_ERROR, - "Action enabler for %s has a local DiplRel " - "requirement %s in target_reqs! Please read the " - "section \"Requirement vector rules\" in " - "doc/README.actions", + _("Action enabler for %s has a local DiplRel " + "requirement %s in target_reqs! Please read the " + "section \"Requirement vector rules\" in " + "doc/README.actions"), action_id_rule_name(act), req_to_fstring(preq, &astr)); astr_free(&astr); @@ -1383,7 +1390,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) || action_has_result_safe(paction, ACTRES_STEAL_MAPS) || action_has_result_safe(paction, ACTRES_SPY_NUKE))) { ruleset_error(logger, LOG_ERROR, - "diplchance_initial_odds: \"%s\" not supported.", + _("diplchance_initial_odds: \"%s\" not supported."), action_rule_name(paction)); ok = FALSE; } @@ -1391,7 +1398,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (BV_ISSET(paction->sub_results, ACT_SUB_RES_HUT_ENTER) && BV_ISSET(paction->sub_results, ACT_SUB_RES_HUT_FRIGHTEN)) { ruleset_error(logger, LOG_ERROR, - "%s both enters and frightens a hut at the same time.", + _("%s both enters and frightens a hut at the same time."), action_rule_name(paction)); ok = FALSE; } @@ -1414,8 +1421,9 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) * attack actions for now. Other actions need more testing and * fixing of issues caused by a worst case action probability of * 0%. */ - ruleset_error(logger, LOG_ERROR, "auto_attack: %s not supported in" - " attack_actions.", + ruleset_error(logger, LOG_ERROR, + _("auto_attack: %s not supported in" + " attack_actions."), action_rule_name(paction)); ok = FALSE; } @@ -1426,7 +1434,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) styles_re_active_iterate(pstyle) { if (basic_city_style_for_style(pstyle) < 0) { ruleset_error(logger, LOG_ERROR, - "There's no basic city style for nation style %s", + _("There's no basic city style for nation style %s"), style_rule_name(pstyle)); ok = FALSE; } @@ -1436,7 +1444,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) music_styles_re_active_iterate(pmus) { if (!sanity_check_req_vec(logger, &pmus->reqs, TRUE, -1, "Music Style")) { ruleset_error(logger, LOG_ERROR, - "Music Styles have conflicting or invalid requirements!"); + _("Music Styles have conflicting or invalid requirements!")); ok = FALSE; } } music_styles_re_active_iterate_end; @@ -1445,7 +1453,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (pterr->animal != NULL) { if (!is_native_to_class(utype_class(pterr->animal), pterr, NULL)) { ruleset_error(logger, LOG_ERROR, - "%s has %s as animal to appear, but it's not native to the terrain.", + _("%s has %s as animal to appear, but it's not native to the terrain."), terrain_rule_name(pterr), utype_rule_name(pterr->animal)); ok = FALSE; } @@ -1455,7 +1463,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) (void) freq; if (!is_extra_caused_by(pres, EC_RESOURCE)) { ruleset_error(logger, LOG_ERROR, - "%s has %s as a resource, but it's not a resource extra.", + _("%s has %s as a resource, but it's not a resource extra."), terrain_rule_name(pterr), extra_rule_name(pres)); ok = FALSE; } @@ -1486,7 +1494,7 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (!can_exist) { ruleset_error(logger, LOG_ERROR, - "Unit class %s cannot exist anywhere.", + _("Unit class %s cannot exist anywhere."), uclass_rule_name(pclass)); ok = FALSE; } @@ -1496,8 +1504,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) achievements_re_active_iterate(pach) { if (!pach->unique && pach->cons_msg == NULL) { ruleset_error(logger, LOG_ERROR, - "Achievement %s has no message for consecutive gainers though " - "it's possible to be gained by multiple players", + _("Achievement %s has no message for consecutive gainers though " + "it's possible to be gained by multiple players"), achievement_rule_name(pach)); ok = FALSE; } @@ -1512,8 +1520,8 @@ bool sanity_check_ruleset_data(struct rscompat_info *compat) if (pnat == NULL) { ruleset_error(logger, LOG_ERROR, - "There's nation %s listed in embedded nations, but there's " - "no such nation.", + _("There's nation %s listed in embedded nations, but there's " + "no such nation."), game.server.ruledit.embedded_nations[nati]); ok = FALSE; } -- 2.43.0