mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Move PluginMetadata::GetSimpleMessages() to ToSimpleMessages()
It's more versatile and would avoid duplication in LOOT's code.
This commit is contained in:
@@ -154,6 +154,19 @@ LOOT_API bool operator>=(const Message& lhs, const Message& rhs);
|
||||
LOOT_API std::optional<SimpleMessage> ToSimpleMessage(
|
||||
const Message& message,
|
||||
const std::string& language);
|
||||
|
||||
/**
|
||||
* Get the messages as SimpleMessages given a language.
|
||||
* @param language
|
||||
* The preferred language for the message content.
|
||||
* @return A vector of SimpleMessage objects for the preferred language, or for
|
||||
* English if message text is not available for the given language. The
|
||||
* order of the input Message objects is preserved, though any messages
|
||||
* without the preferred language or English content will be omitted.
|
||||
*/
|
||||
LOOT_API std::vector<SimpleMessage> ToSimpleMessages(
|
||||
const std::vector<Message>& message,
|
||||
const std::string& language);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -144,15 +144,6 @@ public:
|
||||
*/
|
||||
LOOT_API std::vector<Location> GetLocations() const;
|
||||
|
||||
/**
|
||||
* Get the plugin's messages as SimpleMessage objects for the given language.
|
||||
* @param language
|
||||
* The language to create the SimpleMessage objects for.
|
||||
* @return The plugin's messages as SimpleMessage objects.
|
||||
*/
|
||||
LOOT_API std::vector<SimpleMessage> GetSimpleMessages(
|
||||
const std::string& language) const;
|
||||
|
||||
/**
|
||||
* Set the plugin's group.
|
||||
* @param group
|
||||
|
||||
Reference in New Issue
Block a user