Skip to content

Commit

Permalink
Added option to lang.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Aug 31, 2021
1 parent 1a5c429 commit 031401b
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.config.yaml.YamlBaseConfig;
import com.willfp.eco.util.StringUtils;
import org.jetbrains.annotations.NotNull;

/**
Expand Down Expand Up @@ -42,6 +43,18 @@ public String getNoPermission() {
* @return The message with a prefix appended.
*/
public String getMessage(@NotNull final String message) {
return getPrefix() + this.getString("messages." + message);
return getMessage(message, StringUtils.FormatOption.WITH_PLACEHOLDERS);
}

/**
* Get a chat message.
*
* @param message The key of the message.
* @param option The format options.
* @return The message with a prefix appended.
*/
public String getMessage(@NotNull final String message,
@NotNull final StringUtils.FormatOption option) {
return getPrefix() + this.getString("messages." + message, option);
}
}

0 comments on commit 031401b

Please sign in to comment.