Class MLanguage

    • Constructor Detail

      • MLanguage

        public MLanguage​(Properties ctx,
                         int AD_Language_ID,
                         String trxName)
        Standard Constructor
        Parameters:
        ctx - context
        AD_Language_ID - id
        trxName - transaction
      • MLanguage

        public MLanguage​(Properties ctx,
                         ResultSet rs,
                         String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
    • Method Detail

      • get

        public static MLanguage get​(Properties ctx,
                                    Language lang)
        Get Language Model from Language
        Parameters:
        ctx - context
        lang - language
        Returns:
        language
      • get

        public static MLanguage get​(Properties ctx,
                                    String AD_Language)
        Get Language Model from AD_Language
        Parameters:
        ctx - context
        AD_Language - language e.g. en_US
        Returns:
        language or null
      • getWithLanguage

        public static MLanguage[] getWithLanguage​(Properties ctx,
                                                  String LanguageISO)
        Load Languages (variants) with Language
        Parameters:
        ctx - context
        LanguageISO - language (2 letter) e.g. en
        Returns:
        language
      • maintain

        public static void maintain​(Properties ctx)
        Maintain all active languages
        Parameters:
        ctx - context
      • getLocale

        public Locale getLocale()
        Get Locale
        Returns:
        Locale
      • getDateFormat

        public SimpleDateFormat getDateFormat()
        Get (Short) Date Format. The date format must parseable by org.compiere.grid.ed.MDocDate i.e. leading zero for date and month
        Returns:
        date format MM/dd/yyyy - dd.MM.yyyy
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Before Save
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new
        Returns:
        true/false
      • afterSave

        protected boolean afterSave​(boolean newRecord,
                                    boolean success)
        AfterSave
        Overrides:
        afterSave in class PO
        Parameters:
        newRecord - new
        success - success
        Returns:
        true if saved
      • maintain

        public int maintain​(boolean add)
        Maintain Translation
        Parameters:
        add - if true add missing records - otherwise delete
        Returns:
        number of records deleted/inserted