CleverRaven/Cataclysm-DDA — pull request #7948 by BevapDin (2014-06-12 09:04:23+00:00)
Title: Assure translated and pluralized item names

To enforce the usage of `itype::nname` instead of `itype::name`, that member along with `itype::name_plural` have been made private. Therefor some functions that used `itype::name` directly had to be changed.

Using `itype::name` directly leads to either untranslated item names, or item names that ignore the plural form.

Examples of where untranslated item names (`item.type->name`) show up:
- buying from the caravan in a defense game
- list of recipes of a book
- name of item needed to install in a vehicle
- several search functions (crafting menu) would also use the untranslated name for searching: searching for "mace" gives the recipe for mace (which appears as its translated name), but searching for that translated name gives nothing.
- more, see code changes

This also makes it nearly impossible to use the untranslated item type name (`itype::name`) anywhere and assures that the translated name is used.

----

The second commit makes `item::name` protected. Instead of using that member directly (which contained the untranslated singular item name), use `item::tname`.

Note that `item::name` is stored in the savegame and would therefor *not* change when the language settings change. It's intended for non-translatable names like monster/character names of corpse. Currently it's still initialized with `type::nname(1)`, but it should probably be empty until it's really used (like when making a corpse item).

This also makes it nearly impossible to use the untranslated item name (`item::name`) anywhere and assures that the translated item name is used.

----

Similar `mtype::name` and `mtype::name_plural` are private now. Code uses `mtype::nname` instead. This is basically the same as for items.

----

I changed `some_item.type->name` to `some_item.type->nname(1)` and sometimes to `some_item.tname()`. The second form includes item specific data like the damage attribute. It should be appropriate when it's about a specific item.

`type->nname(1)` is used when the content/damage of the item is not required (e.g. "You pull a %s from your %s" should not be "You pull a arrow from your quiver of arrows" but "You pull a arrow from your quiver"). `tname` would add the "of arrows" to the name.

----

This should finally fix all the basic plural problems like #5334 or #5151. (Maybe the protein powder should still be renamed to "serving of protein powder"/"servings of protein powder" as suggested by @kevingranade?)

----

The last commit removes the item name parameter from the use_healing_item function. The function already gets a pointer to the item that is used and can determine the name of that item on its own.