CMObject
, Tickable
, CMLibrary
, LanguageLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class DirtyLanguage extends StdLibrary implements LanguageLibrary
Modifier and Type | Field | Description |
---|---|---|
protected java.lang.String |
country |
|
protected java.util.Locale |
currentLocale |
|
protected java.lang.String |
language |
idConverter
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
DirtyLanguage() |
Modifier and Type | Method | Description |
---|---|---|
void |
addAutoIgnoredString(java.lang.String str,
DVector fileData,
DVector fileIndexes,
java.lang.String sectionName) |
|
protected java.lang.String |
basicParser(java.lang.String str,
java.lang.String section,
boolean nullIfLonger,
boolean isParser) |
|
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.
|
protected java.lang.String |
filterString(java.lang.String str) |
|
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.
|
protected DVector |
getLanguageParser(java.lang.String parser) |
|
protected java.lang.String |
getLanguageParserKey() |
|
protected DVector |
getLanguageTranslator(java.lang.String parser) |
|
protected java.lang.String |
getLanguageTranslatorKey() |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
insertExpansion(java.util.List<java.lang.String> MORE_CMDS,
java.lang.String str,
int m,
int strLen,
boolean nothingDone) |
|
java.lang.String |
L(java.lang.String str,
java.lang.String... xs) |
Localize an internal string -- shortcut.
|
protected java.util.Hashtable<java.lang.String,DVector> |
loadFileSections(java.lang.String filename) |
|
java.util.List<java.util.List<java.lang.String>> |
preCommandParser(java.util.List<java.lang.String> commands) |
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.
|
void |
propertiesLoaded() |
This method is called whenever system properties are altered by the user.
|
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 |
replaceWithDefinitions(DVector global,
DVector local,
java.lang.String str) |
|
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.
|
protected java.lang.String |
unFilterString(java.lang.String str) |
activate, getServiceClient, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, name, newInstance, setThreadStatus, shutdown, tick
protected java.lang.String language
protected java.lang.String country
protected java.util.Locale currentLocale
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public void setLocale(java.lang.String lang, java.lang.String state)
LanguageLibrary
setLocale
in interface LanguageLibrary
lang
- the language code, default enstate
- the state code, default TXpublic void propertiesLoaded()
CMLibrary
propertiesLoaded
in interface CMLibrary
propertiesLoaded
in class StdLibrary
public java.lang.String replaceWithDefinitions(DVector global, DVector local, java.lang.String str)
protected java.lang.String filterString(java.lang.String str)
protected java.lang.String unFilterString(java.lang.String str)
protected java.util.Hashtable<java.lang.String,DVector> loadFileSections(java.lang.String filename)
protected final java.lang.String getLanguageTranslatorKey()
protected final java.lang.String getLanguageParserKey()
protected DVector getLanguageParser(java.lang.String parser)
protected DVector getLanguageTranslator(java.lang.String parser)
public void clear()
LanguageLibrary
clear
in interface LanguageLibrary
public boolean insertExpansion(java.util.List<java.lang.String> MORE_CMDS, java.lang.String str, int m, int strLen, boolean nothingDone)
public java.util.List<java.util.List<java.lang.String>> preCommandParser(java.util.List<java.lang.String> commands)
LanguageLibrary
preCommandParser
in interface LanguageLibrary
commands
- the pre-parsed command listprotected java.lang.String basicParser(java.lang.String str, java.lang.String section, boolean nullIfLonger, boolean isParser)
public void addAutoIgnoredString(java.lang.String str, DVector fileData, DVector fileIndexes, java.lang.String sectionName)
public java.lang.String preItemParser(java.lang.String item)
LanguageLibrary
preItemParser
in interface LanguageLibrary
item
- the user entered item namepublic java.lang.String failedItemParser(java.lang.String item)
LanguageLibrary
failedItemParser
in interface LanguageLibrary
item
- the user entered item namepublic java.lang.String rawInputParser(java.lang.String words)
LanguageLibrary
rawInputParser
in interface LanguageLibrary
words
- the inputpublic java.lang.String filterTranslation(java.lang.String item)
LanguageLibrary
filterTranslation
in interface LanguageLibrary
item
- ONLY the replacement from a tagpublic java.lang.String sessionTranslation(java.lang.String item)
LanguageLibrary
sessionTranslation
in interface LanguageLibrary
item
- the static stringpublic java.lang.String finalTranslation(java.lang.String item)
LanguageLibrary
finalTranslation
in interface LanguageLibrary
item
- the string to send to the userpublic java.lang.String fullSessionTranslation(java.lang.String str, java.lang.String... xs)
LanguageLibrary
fullSessionTranslation
in interface LanguageLibrary
str
- the variable-laden english system stringxs
- variable values, NOT translatedpublic java.lang.String[] sessionTranslation(java.lang.String[] str)
LanguageLibrary
sessionTranslation
in interface LanguageLibrary
str
- the static string arraypublic java.lang.String commandWordTranslation(java.lang.String str)
LanguageLibrary
commandWordTranslation
in interface LanguageLibrary
str
- a single command wordpublic java.lang.String L(java.lang.String str, java.lang.String... xs)
CMLibrary
L
in interface CMLibrary
L
in class StdLibrary
str
- the string to translatexs
- the array of variables to replaceCall with the string to translate, which may contain variables of the form @x1, @x2, etc. The array in xs
is then used to replace the variables AFTER the string is translated.