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
Modifier and TypeFieldDescriptionstatic boolean
The debug.static String
The Constant ENG_LANG.static String
The Constant FILE_EXTENSION.The flags map.The fonts map.static String
The lang.static File
The lang dir file.The lang list.static org.slf4j.Logger
The Constant Log.static String
The Constant SemicolonReplacement.static String
The Constant SEPARATOR.The map. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkPlaceholders(String line)
Check placeholders in translation.static String
Gets the cur lang short cut.static String
getFilePath(String lng)
Gets the file path.static String
getFont()
Gets the font.static boolean
isAvailable(String lang)
Checks if is available.static void
loadAvailableLangs(File langDir)
Load available langs.static void
loadLangFileToMap(String lng)
Load lang file to map.static String
Translates the text.static String
T html.static String
Translates the text.static String
Returns 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
-