OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 73 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73 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.ui;
14
 package org.openconcerto.ui;
15
 
15
 
-
 
16
import org.openconcerto.utils.i18n.TMPool;
-
 
17
 
-
 
18
import java.util.Locale;
-
 
19
 
16
public class TM extends org.openconcerto.utils.i18n.TM {
20
public class TM extends org.openconcerto.utils.i18n.TM {
-
 
21
    private static final TMPool<TM> POOL = new TMPool<TM>(TM::new);
17
 
22
 
18
    static private final TM INSTANCE = new TM();
23
    static public TM getInstance() {
-
 
24
        return getInstance(getDefaultLocale());
-
 
25
    }
19
 
26
 
20
    static public final TM getInstance() {
27
    static public TM getInstance(final Locale l) {
21
        return INSTANCE;
28
        return POOL.get(l);
22
    }
29
    }
23
 
30
 
24
    static public final String tr(final String key, final Object... args) {
31
    static public final String tr(final String key, final Object... args) {
25
        return getInstance().translate(key, args);
32
        return getInstance().translate(key, args);
26
    }
33
    }
27
 
34
 
28
    private TM() {
35
    private TM(final Locale l) {
-
 
36
        super(l);
29
    }
37
    }
30
}
38
}