Class TranslatableMessageFormatter
The translatable message formatter is mainly used for replacing placeholders in translatable message
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatCost
(String unformattedMessage, double cost) Replaces the %cost% in a string with the given coststatic String
formatFlags
(String unformattedMessage, Set<PortalFlag> flags) Replaces the %flags% in a string with the given set of flagsstatic String
formatNetwork
(String unformattedMessage, String networkName) Replaces the %network% in a string with the given network namestatic String
formatNetworkType
(String message, NetworkType type, LanguageManager languageManager) static String
formatPortal
(String unformattedMessage, String portalName) Replaces the %portal% in a string with the given portal namestatic String
formatUnimplementedConflictMessage
(Network interServer, Network local, LanguageManager languageManager) Format theTranslatableMessage.UNIMPLEMENTED_CONFLICT
static String
formatVersion
(String unformattedMessage, String version) Replaces the %version% in a string with the given versionstatic String
formatWorld
(String unformattedMessage, String worldName) Replaces the %world% in a string with the given world name
-
Method Details
-
formatCost
Replaces the %cost% in a string with the given cost- Parameters:
unformattedMessage
-The unformatted message to format
cost
-The cost to insert
- Returns:
The message with the cost placeholder replaced with the given cost
-
formatPortal
Replaces the %portal% in a string with the given portal name- Parameters:
unformattedMessage
-The unformatted message to format
portalName
-The portal name to replace the placeholder with
- Returns:
The message with the portal placeholder replaced with the given portal name
-
formatWorld
Replaces the %world% in a string with the given world name- Parameters:
unformattedMessage
-The unformatted message to format
worldName
-The world name to replace the placeholder with
- Returns:
The message with the world placeholder replaced with the given world name
-
formatNetwork
Replaces the %network% in a string with the given network name- Parameters:
unformattedMessage
-The unformatted message to format
networkName
-The network name to replace the placeholder with
- Returns:
The message with the network name placeholder replaced with the given network name
-
formatFlags
Replaces the %flags% in a string with the given set of flags- Parameters:
unformattedMessage
-The unformatted message to format
flags
-The flags to replace the placeholder with
- Returns:
The message with the flags placeholder replaced with the given flags
-
formatVersion
Replaces the %version% in a string with the given version- Parameters:
unformattedMessage
-The unformatted message to format
version
-The version to replace the placeholder with
- Returns:
The message with the version placeholder replaced with the given version
-
formatUnimplementedConflictMessage
public static String formatUnimplementedConflictMessage(Network interServer, @Nullable Network local, LanguageManager languageManager) Format theTranslatableMessage.UNIMPLEMENTED_CONFLICT
- Parameters:
interServer
-The inter-server network at conflict
local
-The local network at conflict (none if null)
languageManager
-A languageManager
- Returns:
A formated
TranslatableMessage.UNIMPLEMENTED_CONFLICT
message
-
formatNetworkType
public static String formatNetworkType(String message, NetworkType type, LanguageManager languageManager)
-