Skip to content

Commit

Permalink
object_settings.cpp: Support translation in the music describer
Browse files Browse the repository at this point in the history
  • Loading branch information
James De Ricco committed Dec 8, 2023
1 parent 9f64722 commit 60276d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/editor/object_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sexp/value.hpp>

#include "audio/sound_file.hpp"
#include "fmt/format.h"
#include "util/file_system.hpp"
#include "util/gettext.hpp"
#include "video/color.hpp"
Expand Down Expand Up @@ -316,10 +317,12 @@ ObjectSettings::add_music(const std::string& text, std::string* value_ptr,

const std::string filename = FileSystem::basename(path);
const std::string title_or_filename = title.empty() ? filename : "\"" + title + "\""; // assumes path is just a filename
const std::string written_by = fmt::format(fmt::runtime(_("by {}")), author);
const std::string license_statement = fmt::format(fmt::runtime(_("License: {}")), license);

const std::string help_text =
title_or_filename + (author.empty() ? "" : "\n by " + author)
+ (license.empty() ? "" : "\nLicense: " + license);
title_or_filename + (author.empty() ? "" : "\n" + written_by)
+ (license.empty() ? "" : "\n" + license_statement);

return help_text;
};
Expand Down

0 comments on commit 60276d2

Please sign in to comment.