1 package org.seasar.cubby.util;
2
3 import static org.seasar.cubby.CubbyConstants.RES_MESSAGES;
4
5 import java.text.MessageFormat;
6 import java.util.ResourceBundle;
7
8 import org.seasar.framework.util.ResourceBundleUtil;
9
10
11
12
13
14 public class Messages {
15
16
17
18
19
20
21
22
23 public static String getText(ResourceBundle resource, String key,
24 Object... args) {
25 return MessageFormat.format(resource.getString(key), args);
26 }
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 public static String getText(String key, Object... args) {
42 ResourceBundle resource = ResourceBundleUtil.getBundle(RES_MESSAGES,
43 LocaleHolder.getLocale());
44 return getText(resource, key, args);
45 }
46 }