OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 93 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 93 Rev 177
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.utils;
14
 package org.openconcerto.erp.utils;
15
 
15
 
16
import org.openconcerto.sql.UserPropsTM;
16
import org.openconcerto.utils.i18n.TMPool;
17
 
17
 
18
public class TM extends UserPropsTM {
18
import java.util.Locale;
19
 
19
 
20
    static private final TM INSTANCE = new TM();
20
public class TM extends org.openconcerto.utils.i18n.TM {
21
 
21
 
-
 
22
    private static final TMPool<TM> POOL = new TMPool<TM>(TM::new);
-
 
23
 
22
    static public final TM getTM() {
24
    static private final TM getTM() {
-
 
25
        return getERP_TM(getDefaultLocale());
-
 
26
    }
-
 
27
 
-
 
28
    static public TM getERP_TM(final Locale l) {
23
        return INSTANCE;
29
        return POOL.get(l);
24
    }
30
    }
25
 
31
 
26
    static public final String tr(final String key, final Object... args) {
32
    static public final String tr(final String key, final Object... args) {
27
        return getTM().translate(key, args);
33
        return getTM().translate(key, args);
28
    }
34
    }
29
 
35
 
30
    private TM() {
36
    private TM(final Locale l) {
-
 
37
        super(l);
31
    }
38
    }
32
 
39
 
33
}
40
}