diff --git a/data/json/body_parts.json b/data/json/body_parts.json index e1c442afe2631..37fca05f6b4ce 100644 --- a/data/json/body_parts.json +++ b/data/json/body_parts.json @@ -3,8 +3,8 @@ "id": "torso", "type": "body_part", "name": "torso", - "heading_singular": "Torso", - "heading_plural": "Torso", + "heading": "Torso", + "heading_multiple": "Torso", "hp_bar_ui_text": "TORSO", "encumbrance_text": "Dodging and melee is hampered.", "main_part": "torso", @@ -20,8 +20,8 @@ "id": "head", "type": "body_part", "name": "head", - "heading_singular": "Head", - "heading_plural": "Head", + "heading": "Head", + "heading_multiple": "Head", "hp_bar_ui_text": "HEAD", "encumbrance_text": "", "main_part": "head", @@ -37,8 +37,8 @@ "id": "eyes", "type": "body_part", "name": "eyes", - "heading_singular": "Eyes", - "heading_plural": "Eyes", + "heading": "Eyes", + "heading_multiple": "Eyes", "encumbrance_text": "Ranged combat is hampered.", "main_part": "head", "opposite_part": "eyes", @@ -53,8 +53,8 @@ "id": "mouth", "type": "body_part", "name": "mouth", - "heading_singular": "Mouth", - "heading_plural": "Mouth", + "heading": "Mouth", + "heading_multiple": "Mouth", "encumbrance_text": "Running is slowed.", "main_part": "head", "opposite_part": "mouth", @@ -69,9 +69,9 @@ "id": "arm_l", "type": "body_part", "name": "left arm", - "name_plural": "arms", - "heading_singular": "L. Arm", - "heading_plural": "Arms", + "name_multiple": "arms", + "heading": "L. Arm", + "heading_multiple": "Arms", "encumbrance_text": "Melee and ranged combat is hampered.", "hp_bar_ui_text": "L ARM", "main_part": "arm_l", @@ -87,9 +87,9 @@ "id": "arm_r", "type": "body_part", "name": "right arm", - "name_plural": "arms", - "heading_singular": "R. Arm", - "heading_plural": "Arms", + "name_multiple": "arms", + "heading": "R. Arm", + "heading_multiple": "Arms", "hp_bar_ui_text": "R ARM", "encumbrance_text": "Melee and ranged combat is hampered.", "main_part": "arm_r", @@ -105,9 +105,9 @@ "id": "hand_l", "type": "body_part", "name": "left hand", - "name_plural": "hands", - "heading_singular": "L. Hand", - "heading_plural": "Hands", + "name_multiple": "hands", + "heading": "L. Hand", + "heading_multiple": "Hands", "encumbrance_text": "Manual tasks are slowed.", "main_part": "arm_l", "opposite_part": "hand_r", @@ -122,9 +122,9 @@ "id": "hand_r", "type": "body_part", "name": "right hand", - "name_plural": "hands", - "heading_singular": "R. Hand", - "heading_plural": "Hands", + "name_multiple": "hands", + "heading": "R. Hand", + "heading_multiple": "Hands", "encumbrance_text": "Manual tasks are slowed.", "main_part": "arm_r", "opposite_part": "hand_l", @@ -139,9 +139,9 @@ "id": "leg_l", "type": "body_part", "name": "left leg", - "name_plural": "legs", - "heading_singular": "L. Leg", - "heading_plural": "Legs", + "name_multiple": "legs", + "heading": "L. Leg", + "heading_multiple": "Legs", "hp_bar_ui_text": "L LEG", "encumbrance_text": "Running and swimming are slowed.", "main_part": "leg_l", @@ -157,9 +157,9 @@ "id": "leg_r", "type": "body_part", "name": "right leg", - "name_plural": "legs", - "heading_singular": "R. Leg", - "heading_plural": "Legs", + "name_multiple": "legs", + "heading": "R. Leg", + "heading_multiple": "Legs", "hp_bar_ui_text": "R LEG", "encumbrance_text": "Running and swimming are slowed.", "main_part": "leg_r", @@ -175,9 +175,9 @@ "id": "foot_l", "type": "body_part", "name": "left foot", - "name_plural": "feet", - "heading_singular": "L. Foot", - "heading_plural": "Feet", + "name_multiple": "feet", + "heading": "L. Foot", + "heading_multiple": "Feet", "encumbrance_text": "Running is slowed.", "main_part": "leg_l", "opposite_part": "foot_r", @@ -192,9 +192,9 @@ "id": "foot_r", "type": "body_part", "name": "right foot", - "name_plural": "feet", - "heading_singular": "R. Foot", - "heading_plural": "Feet", + "name_multiple": "feet", + "heading": "R. Foot", + "heading_multiple": "Feet", "encumbrance_text": "Running is slowed.", "main_part": "leg_r", "opposite_part": "foot_l", @@ -209,8 +209,8 @@ "id": "num_bp", "type": "body_part", "name": "appendix", - "heading_singular": "appendix", - "heading_plural": "Appendices", + "heading": "appendix", + "heading_multiple": "Appendices", "encumbrance_text": "It's inflamed.", "main_part": "num_bp", "opposite_part": "num_bp", diff --git a/src/bodypart.cpp b/src/bodypart.cpp index 995313c5640ff..2aff763cddecb 100644 --- a/src/bodypart.cpp +++ b/src/bodypart.cpp @@ -183,9 +183,15 @@ void body_part_struct::load( const JsonObject &jo, const std::string & ) mandatory( jo, was_loaded, "id", id ); mandatory( jo, was_loaded, "name", name ); - optional( jo, was_loaded, "name_plural", name_multiple ); - mandatory( jo, was_loaded, "heading_singular", name_as_heading_singular ); - mandatory( jo, was_loaded, "heading_plural", name_as_heading_multiple ); + // This is NOT the plural of `name`; it's a name refering to the pair of + // bodyparts which this bodypart belongs to, and thus should not be implemented + // using "ngettext" or "translation::make_plural". Otherwise, in languages + // without plural forms, translation of this string would indicate it + // to be a left or right part, while it is not. + optional( jo, was_loaded, "name_multiple", name_multiple ); + mandatory( jo, was_loaded, "heading", name_as_heading ); + // Same as the above comment + mandatory( jo, was_loaded, "heading_multiple", name_as_heading_multiple ); optional( jo, was_loaded, "hp_bar_ui_text", hp_bar_ui_text ); mandatory( jo, was_loaded, "encumbrance_text", encumb_text ); mandatory( jo, was_loaded, "hit_size", hit_size ); @@ -276,7 +282,7 @@ std::string body_part_name_accusative( body_part bp, int number ) std::string body_part_name_as_heading( body_part bp, int number ) { const auto &bdy = get_bp( bp ); - return number > 1 ? _( bdy.name_as_heading_multiple ) : _( bdy.name_as_heading_singular ); + return number > 1 ? _( bdy.name_as_heading_multiple ) : _( bdy.name_as_heading ); } std::string body_part_hp_bar_ui_text( body_part bp ) diff --git a/src/bodypart.h b/src/bodypart.h index 91ceee47a0d73..94207ebee322d 100644 --- a/src/bodypart.h +++ b/src/bodypart.h @@ -72,7 +72,7 @@ struct body_part_struct { // Those are stored untranslated std::string name; std::string name_multiple; - std::string name_as_heading_singular; + std::string name_as_heading; std::string name_as_heading_multiple; std::string hp_bar_ui_text; std::string encumb_text;