Class chargerLesTraductions

java.lang.Object
fr.formiko.usuel.chargerLesTraductions

public class chargerLesTraductions extends Object
Loard translation file class.
Author:
Hydrolien
  • Field Details

    • map

      private static HashMap<String,​String> map
    • rep

      private static String rep
    • tLangue

      private static String[] tLangue
    • defaultLanguage

      private static int defaultLanguage
  • Constructor Details

    • chargerLesTraductions

      public chargerLesTraductions()
  • Method Details

    • getTLangue

      public static String[] getTLangue()
    • setTLangue

      public static void setTLangue(String[] t)
    • getRep

      public static String getRep()
    • setRep

      public static void setRep(String s)
    • setRep

      public static void setRep()
    • getMap

      public static HashMap<String,​String> getMap()
    • iniMap

      public static void iniMap()
    • getLanguage

      public static String getLanguage(int x)
      get the int that corresponds to the language String.
      Parameters:
      x - language id.
      Returns:
      language String in ISO code 639-1 if tLangue is correct.
    • getLanguage

      public static int getLanguage(String s)
      get the String that corresponds to the language int.
      An error will return 2, the id of "en" (english) (except if tLangue isn't correctly loard (return -1;))
      Parameters:
      s - language String in ISO code 639-1.
    • getLanguageAsString

      public static String getLanguageAsString(int x)
    • getLanguageAsString

      public static String getLanguageAsString(String x)
    • getDefautlLanguage

      public static int getDefautlLanguage()
      Return defaultLanguage if it is aviable or -1.
    • iniTLangue

      public static boolean iniTLangue()
      Loard language file "langue.csv".
      If it fail only "en" will be aviable.
    • créerLesFichiers

      public static boolean créerLesFichiers()
      Check that every language file exists and create is if it's need.
    • estLigneDeTrad

      public static boolean estLigneDeTrad(String s)
      Check that the line is a translation line.
      Parameters:
      s - line to check
    • getTableauDesTrad

      public static String[] getTableauDesTrad(int langue)
      get an array of translation for a given language.
      Parameters:
      langue - id if the language
    • getTableauDesNationsName

      public static String[] getTableauDesNationsName()
      Load translation for nation name.
    • getTableauDesCmd

      public static String[] getTableauDesCmd()
      get an array of command.
    • chargerLesTraductions

      public static HashMap<String,​String> chargerLesTraductions(int langue)
      Load translation for a given language.
      It included command.
      Parameters:
      langue - id if the language
    • chargerLesTraductionsSansCommande

      public static HashMap<String,​String> chargerLesTraductionsSansCommande(int langue)
      Load translation for a given language.
      It don't included command.
      Parameters:
      langue - id if the language
    • chargerLesNationsName

      public static HashMap<String,​String> chargerLesNationsName()
      Load translation for nation name.
    • addObjetMap

      public static void addObjetMap(String s)
      Add a translated line on the actual map.
      Parameters:
      s - Translated line.
    • addTradAuto

      public static void addTradAuto()
      Add auto translation for every languages.
      Please refert to ThTrad to have more informations
    • getPourcentageTraduit

      public static int getPourcentageTraduit(int langue)
      Count the %age translated.
      It don't included command (that are not translate).
      Parameters:
      langue - id if the language
    • getPourcentageTraduitAutomatiquement

      public static int getPourcentageTraduitAutomatiquement(int langue)
      Count the %age translated automatically.
      It don't included command (that are not translate).
      Parameters:
      langue - id if the language
    • affPourcentageTraduit

      public static void affPourcentageTraduit()
      Print getPourcentageTraduitAutomatiquement and getPourcentageTraduit data for every languages.
    • fini

      public static boolean fini(String s)
    • completMapWithFullTranslatedLanguage

      public static void completMapWithFullTranslatedLanguage()
      Add untranslated key to the actual Map.
      For all key in english map, if key isn't in g.getMap() we add it.