Skip to content

Commit

Permalink
Fix footsteps translation (#37402)
Browse files Browse the repository at this point in the history
  • Loading branch information
8street authored and ZhilkinSerg committed Jan 27, 2020
1 parent 4eee8c7 commit ca1e290
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/monstergenerator.cpp
Expand Up @@ -888,8 +888,7 @@ void MonsterGenerator::load_species( const JsonObject &jo, const std::string &sr
void species_type::load( const JsonObject &jo, const std::string & )
{
optional( jo, was_loaded, "description", description );
optional( jo, was_loaded, "footsteps", footsteps, "footsteps." );
footsteps = _( footsteps );
optional( jo, was_loaded, "footsteps", footsteps, to_translation( "footsteps." ) );
const auto flag_reader = enum_flags_reader<m_flag> { "monster flag" };
optional( jo, was_loaded, "flags", flags, flag_reader );

Expand Down
4 changes: 2 additions & 2 deletions src/monstergenerator.h
Expand Up @@ -28,13 +28,13 @@ struct species_type {
species_id id;
bool was_loaded = false;
translation description;
std::string footsteps;
translation footsteps;
enum_bitset<m_flag> flags;
enum_bitset<mon_trigger> anger;
enum_bitset<mon_trigger> fear;
enum_bitset<mon_trigger> placate;
std::string get_footsteps() const {
return footsteps;
return footsteps.translated();
}

species_type(): id( species_id::NULL_ID() ) {
Expand Down
2 changes: 1 addition & 1 deletion src/mtype.cpp
Expand Up @@ -233,5 +233,5 @@ std::string mtype::get_footsteps() const
for( const species_id &s : species ) {
return s.obj().get_footsteps();
}
return "footsteps.";
return _( "footsteps." );
}

0 comments on commit ca1e290

Please sign in to comment.