DirtyLanguage
public interface LanguageLibrary extends CMLibrary
idConverter
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
Clears the cache of both the translator and the parser,
allowing it all to be reloaded from the properties
files on the filesystem.
|
java.lang.String |
commandWordTranslation(java.lang.String str) |
This unique translator is mostly run at boot time to
translate the cached command words of commands, abilities,
and similar things to the localized term.
|
java.lang.String |
failedItemParser(java.lang.String item) |
When a command or some other process is requesting access to
a room or inventory item by name, and the entry from the user
fails to find the item, this filter will be called to provide
a "second chance" item name.
|
java.lang.String |
filterTranslation(java.lang.String item) |
The filter translation is an output translation that only handles
pronoun tags, like S-NAME, T-YOUPOSS, etc.
|
java.lang.String |
finalTranslation(java.lang.String item) |
After an output string has gone through all the other
processes, if there are any other translations to be
done, this will handle it.
|
java.lang.String |
fullSessionTranslation(java.lang.String str,
java.lang.String... xs) |
This is the main output and variable translator.
|
java.util.List<java.util.List<java.lang.String>> |
preCommandParser(java.util.List<java.lang.String> CMDS) |
Accepts user-entered pre-parsed command list, and generates
a list containing one or more translated full command lists.
|
java.lang.String |
preItemParser(java.lang.String item) |
When a command or some other process is requesting access to
a room or inventory item by name, or sometimes and exit, then
this parser is called with the user input to translate things
into a final search string.
|
java.lang.String |
rawInputParser(java.lang.String words) |
During login or other input that does not involve commands,
this input parser can translate input.
|
java.lang.String |
sessionTranslation(java.lang.String item) |
A translator for static internal string, such
as those found on interfaces.
|
java.lang.String[] |
sessionTranslation(java.lang.String[] str) |
A translator for static internal string arrays, such
as those found on interfaces.
|
void |
setLocale(java.lang.String lang,
java.lang.String state) |
Initializes the localization library by setting the
language and state code, thus pointing the mud at which
translation properties files to use.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
void clear()
java.lang.String finalTranslation(java.lang.String item)
item
- the string to send to the userjava.lang.String sessionTranslation(java.lang.String item)
item
- the static stringjava.lang.String[] sessionTranslation(java.lang.String[] str)
str
- the static string arrayjava.lang.String fullSessionTranslation(java.lang.String str, java.lang.String... xs)
str
- the variable-laden english system stringxs
- variable values, NOT translatedjava.lang.String filterTranslation(java.lang.String item)
item
- ONLY the replacement from a tagvoid setLocale(java.lang.String lang, java.lang.String state)
lang
- the language code, default enstate
- the state code, default TXjava.util.List<java.util.List<java.lang.String>> preCommandParser(java.util.List<java.lang.String> CMDS)
CMDS
- the pre-parsed command listjava.lang.String commandWordTranslation(java.lang.String str)
str
- a single command wordjava.lang.String preItemParser(java.lang.String item)
item
- the user entered item namejava.lang.String failedItemParser(java.lang.String item)
item
- the user entered item namejava.lang.String rawInputParser(java.lang.String words)
words
- the input