Class FallbackLocaleGenerationEvent
- Namespace
- MonkeyLoader.Resonite.Locale
- Assembly
- MonkeyLoader.Resonite.Integration.dll
Represents the event data for the Fallback Locale Generation Event.
public sealed class FallbackLocaleGenerationEvent : AsyncEvent
- Inheritance
-
FallbackLocaleGenerationEvent
- Inherited Members
Remarks
This event can be used by Monkeys that make use of locale keys to inject programmatically generated keys, if they haven't been defined previously.
Methods
AddMessage(string, string)
Adds the given message for the key if there's no message associated with it yet.
public bool AddMessage(string key, string message)
Parameters
Returns
- bool
true
if the message was newly assigned; otherwise,false
.
GetMessage(string)
Gets the message pattern associated with the given key.
public string GetMessage(string key)
Parameters
key
stringThe key to get the message for.
Returns
- string
The message associated with the key.
Exceptions
- KeyNotFoundException
When there's no message associated with the key.
TryGetMessage(string, out string?)
Tries to get the message pattern associated with the given key.
public bool TryGetMessage(string key, out string? message)
Parameters
key
stringThe key to get the message for.
message
stringThe message associated with the key, or
null
if it wasn't found.
Returns
- bool
true
if the key was found; otherwise,false
.