Class Lang

java.lang.Object
overit.geocall.lang.Lang
All Implemented Interfaces:
Serializable

public class Lang extends Object implements Serializable
This class implements the Lang object, ie the object that defines a language that can be used in the application; at each language must correspond a dictionary file, containing the translations of the static and dynamic content.
See Also:
  • Field Details

    • DEVELOP_LANG

      public static final Lang DEVELOP_LANG
      Default Lang
    • DEVELOP_SDF_PARSE

      public static final String DEVELOP_SDF_PARSE
      Default string that defines the format used to parse the Date by the develop language
      See Also:
    • DEVELOP_SDF_FORMAT

      public static final String DEVELOP_SDF_FORMAT
      Default format string used to format the Date by the develop language
      See Also:
    • DEVELOP_TIME_HOUR_SYSTEM

      public static final String DEVELOP_TIME_HOUR_SYSTEM
      Default format string used to display hours using 24h or 12h format
      See Also:
    • DEVELOP_FIRST_DAY_OF_WEEK

      public static final String DEVELOP_FIRST_DAY_OF_WEEK
      Default string that defines the first day of week, that is (m)onday, for the develop language
      See Also:
    • DEVELOP_DF

      public static final String DEVELOP_DF
      Default string that defines the decimal format for the develop language
      See Also:
    • DEVELOP_DF_SYMBOLS

      public static final String DEVELOP_DF_SYMBOLS
      Default string that defines the decimal format symbols for the develop language
      See Also:
    • DEVELOP_DF_CURRENCY

      public static final String DEVELOP_DF_CURRENCY
      Default string that defines the format used for currency by the develop language
      See Also:
    • DEVELOP_DF_CURRENCY_SYMBOLS

      public static final String DEVELOP_DF_CURRENCY_SYMBOLS
      Default string that defines the currency format symbols for the develop language
      See Also:
    • _label

      protected String _label
    • _name

      protected String _name
    • _ianaCode

      protected String _ianaCode
    • _icon

      protected String _icon
    • _type

      protected LangType _type
    • _hintsMailAddress

      protected String _hintsMailAddress
    • _hintsMailService

      protected String _hintsMailService
    • hintsMailSender

      protected String hintsMailSender
    • _cacheSize

      protected int _cacheSize
    • _tableSuffix

      protected String _tableSuffix
  • Constructor Details

    • Lang

      public Lang(String name, String label)
      Creates a Lang with the name and the label passed as parameters
      Parameters:
      name - The name of the lang, that must corresponds to the name of the dictionary file that you want to use for the language
      label - The label associated to the lang
    • Lang

      public Lang(Getter g)
      Creates a Lang starting from the Getter passed as parameter
      Parameters:
      g - The Getter that stores the information of the language
    • Lang

      public Lang(overit.geocall.config.Config config, String langId)
  • Method Details

    • getWebContextLangName

      @Deprecated(forRemoval=true) public static String getWebContextLangName(String agentLang, ServletContext sc)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      agentLang - the accepted language provided by the browser
      sc - the ServletContext
      Returns:
      the name of the system language or null if no match has been found
    • getSystemDefaultLangName

      public static String getSystemDefaultLangName(String agentLang)
      Extract the name of the system default language starting by the accepted languages provided by the user-agent
      Parameters:
      agentLang - the accepted language provided by the browser
      Returns:
      the name of the system language or null if no match has been found
    • getCompanyDefaultLangName

      public static String getCompanyDefaultLangName(Company company, String lang)
      Extract the name of the system default language starting by the accepted languages provided by the user-agent
      Parameters:
      company - the reference company
      lang - the desired language
      Returns:
      the name of the company language or null if no match has been found
    • deblank

      protected static String deblank(String s)
      Returns the string itself, Null if is empty
      Parameters:
      s - The string to investigate
      Returns:
      The string itself, Null if is empty
    • getLabel

      public String getLabel()
      Returns the label associated to the Lang
      Returns:
      The label associated to the Lang
    • getName

      public String getName()
      Returns the name of the Lang, that corresponds to the name of the dictionary file used for the language
      Returns:
      The name of the Lang
    • getHintsMailAddress

      public String getHintsMailAddress()
      Returns the email address that will receive the translation hints from the user interaction with the collaborative translation manage pages
      Returns:
      The email address (usually refers to a language expert)
    • getHintsMailService

      public String getHintsMailService()
      Returns the mail service used to send the email, containing the translation hints, sended by the user that interact with the collaborative translation manage pages
      Returns:
      The mail service
    • getHintsMailSender

      public String getHintsMailSender()
      Returns the mail sender used to send the email, this will be the email address used to send the hints.
      Returns:
      The mail sender used to send the email.
    • getTableSuffix

      public String getTableSuffix()
      Returns the attribute used to assign the values of each translation to the correct data model field
      Returns:
      The suffix used to point to the correct data model field
    • getCacheSize

      public int getCacheSize()
      Returns the size of the cache of the Lang
      Returns:
      The size of the cache (the default value is 600 entries)
    • getIanaCode

      public String getIanaCode()
      Returns the attribute used to assign the IANA code to the Lang
      Returns:
      The IANA code of the Lang
    • getIcon

      public String getIcon()
      Return the icon representing the flag of the state in which this language is used.
      Returns:
      the path of the icon.
    • getType

      public LangType getType()
    • isPartial

      public boolean isPartial()
      Checks if the Lang is partial, ie if it will highlight with the square brackets the labels that don't have a translation
      Returns:
      true if the languaga is partial, null otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • largeequality

      protected static final boolean largeequality(Object o1, Object o2)