Package com.strategyquant.lib
Class L
java.lang.Object
com.strategyquant.lib.L
Language translation class for Java backend.
Usage is simple -whenever you write a string that should be translated use L.t("String to be translated").
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanThe debug.static StringThe Constant ENG_LANG.static StringThe Constant FILE_EXTENSION.The flags map.The fonts map.static StringThe lang.static FileThe lang dir file.The lang list.static org.slf4j.LoggerThe Constant Log.static StringThe Constant SemicolonReplacement.static StringThe Constant SEPARATOR.The map. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckPlaceholders(String line)Check placeholders in translation.static StringGets the cur lang short cut.static StringgetFilePath(String lng)Gets the file path.static StringgetFont()Gets the font.static booleanisAvailable(String lang)Checks if is available.static voidloadAvailableLangs(File langDir)Load available langs.static voidloadLangFileToMap(String lng)Load lang file to map.static StringTranslates the text.static StringT html.static StringTranslates the text.static StringReturns the text passed as argument.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log. -
SEPARATOR
The Constant SEPARATOR.- See Also:
- Constant Field Values
-
SemicolonReplacement
The Constant SemicolonReplacement.- See Also:
- Constant Field Values
-
FILE_EXTENSION
The Constant FILE_EXTENSION.- See Also:
- Constant Field Values
-
ENG_LANG
The Constant ENG_LANG.- See Also:
- Constant Field Values
-
langList
The lang list. -
translations
The map. -
flagsMap
The flags map. -
fontsMap
The fonts map. -
lang
The lang. -
langDirFile
The lang dir file. -
debug
public static boolean debugThe debug.
-
-
Method Details
-
isAvailable
Checks if is available.- Parameters:
lang- the lang- Returns:
- true, if is available
-
tsq
Returns the text passed as argument. This method is used as a special tag L.tsq for recognizing translations while parsing lang files.- Parameters:
text- the text- Returns:
- the string
-
tnp
Translates the text. It is the same as L.t function but L.tnp is not parsed by LFileGen tnp is an abbreviation translate but not parse :)- Parameters:
text- the textargs-- Returns:
- the string
-
t
Translates the text.- Parameters:
text- the textargs-- Returns:
- the string
-
tHtml
T html.- Parameters:
text- the text- Returns:
- the string
-
getFilePath
Gets the file path.- Parameters:
lng- the lng- Returns:
- the file path
-
loadLangFileToMap
Load lang file to map.- Parameters:
lng- the lng
-
checkPlaceholders
Check placeholders in translation.- Parameters:
line- the line
-
loadAvailableLangs
Load available langs.- Parameters:
langDir- the lang dir
-
getCurLangShortCut
Gets the cur lang short cut.- Returns:
- the cur lang short cut
-
getFont
Gets the font.- Returns:
- the font
-