Class L

java.lang.Object
com.strategyquant.lib.L

public class L extends Object
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 Details

    • Log

      public static final org.slf4j.Logger Log
      The Constant Log.
    • SEPARATOR

      public static final String SEPARATOR
      The Constant SEPARATOR.
      See Also:
      Constant Field Values
    • SemicolonReplacement

      public static final String SemicolonReplacement
      The Constant SemicolonReplacement.
      See Also:
      Constant Field Values
    • FILE_EXTENSION

      public static final String FILE_EXTENSION
      The Constant FILE_EXTENSION.
      See Also:
      Constant Field Values
    • ENG_LANG

      public static final String ENG_LANG
      The Constant ENG_LANG.
      See Also:
      Constant Field Values
    • langList

      public static ArrayList<String> langList
      The lang list.
    • map

      public static TreeMap<String,​String> map
      The map.
    • flagsMap

      public static Map<String,​String> flagsMap
      The flags map.
    • fontsMap

      public static Map<String,​String> fontsMap
      The fonts map.
    • lang

      public static String lang
      The lang.
    • langDirFile

      public static File langDirFile
      The lang dir file.
    • debug

      public static boolean debug
      The debug.
  • Method Details

    • isAvailable

      public static boolean isAvailable(String lang)
      Checks if is available.
      Parameters:
      lang - the lang
      Returns:
      true, if is available
    • tsq

      public static String tsq(String text)
      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
    • t

      public static String t(String text, Object... args)
      Translates the text.
      Parameters:
      text - the text
      args -
      Returns:
      the string
    • tHtml

      public static String tHtml(String text)
      T html.
      Parameters:
      text - the text
      Returns:
      the string
    • getFilePath

      public static String getFilePath(String lng)
      Gets the file path.
      Parameters:
      lng - the lng
      Returns:
      the file path
    • loadLangFileToMap

      public static void loadLangFileToMap(String lng)
      Load lang file to map.
      Parameters:
      lng - the lng
    • loadAvailableLangs

      public static void loadAvailableLangs(File langDir)
      Load available langs.
      Parameters:
      langDir - the lang dir
    • getCurLangShortCut

      public static String getCurLangShortCut()
      Gets the cur lang short cut.
      Returns:
      the cur lang short cut
    • getFont

      public static String getFont()
      Gets the font.
      Returns:
      the font