diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index ea1a1e0cb8f03..9609094e98647 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -693,7 +693,7 @@ static void butchery_drops_harvest( item *corpse_item, const mtype &mt, player & const std::function &roll_butchery, butcher_type action, const std::function &roll_drops ) { - p.add_msg_if_player( m_neutral, _( mt.harvest->message() ) ); + p.add_msg_if_player( m_neutral, mt.harvest->message() ); int monster_weight = to_gram( mt.weight ); monster_weight += round( monster_weight * rng_float( -0.1, 0.1 ) ); if( corpse_item->has_flag( "QUARTERED" ) ) { diff --git a/src/harvest.cpp b/src/harvest.cpp index af018b17bd90d..f10e8a4960687 100644 --- a/src/harvest.cpp +++ b/src/harvest.cpp @@ -11,6 +11,7 @@ #include "item_group.h" #include "output.h" #include "json.h" +#include "text_snippets.h" // TODO: Make a generic factory static std::map harvest_all; @@ -44,7 +45,7 @@ const harvest_id &harvest_list::id() const std::string harvest_list::message() const { - return message_; + return SNIPPET.expand( message_.translated() ); } bool harvest_list::is_null() const @@ -81,9 +82,7 @@ const harvest_id &harvest_list::load( const JsonObject &jo, const std::string &s jo.throw_error( "id was not specified for harvest" ); } - if( jo.has_string( "message" ) ) { - ret.message_ = jo.get_string( "message" ); - } + jo.read( "message", ret.message_ ); for( const JsonObject current_entry : jo.get_array( "entries" ) ) { ret.entries_.push_back( harvest_entry::load( current_entry, src ) ); diff --git a/src/harvest.h b/src/harvest.h index 385dddf246e85..b55f6ce28d4bd 100644 --- a/src/harvest.h +++ b/src/harvest.h @@ -10,6 +10,7 @@ #include #include "string_id.h" +#include "translations.h" #include "type_id.h" using itype_id = std::string; @@ -86,7 +87,7 @@ class harvest_list harvest_id id_; std::list entries_; std::set names_; - std::string message_; + translation message_; void finalize(); };