Package graphql.i18n
Class I18n
- java.lang.Object
-
- graphql.i18n.I18n
-
public class I18n extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classI18n.BundleTypeThis enum is a type safe way to control what resource bundle to load from
-
Constructor Summary
Constructors Modifier Constructor Description protectedI18n(I18n.BundleType bundleType, java.util.Locale locale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.LocalegetLocale()java.util.ResourceBundlegetResourceBundle()static I18ni18n(I18n.BundleType bundleType, java.util.Locale locale)java.lang.Stringmsg(java.lang.String msgKey, java.lang.Object... msgArgs)Creates an I18N message using the key and argumentsjava.lang.Stringmsg(java.lang.String msgKey, java.util.List<java.lang.Object> msgArgs)Creates an I18N message using the key and arguments
-
-
-
Constructor Detail
-
I18n
protected I18n(I18n.BundleType bundleType, java.util.Locale locale)
-
-
Method Detail
-
getLocale
public java.util.Locale getLocale()
-
getResourceBundle
public java.util.ResourceBundle getResourceBundle()
-
i18n
public static I18n i18n(I18n.BundleType bundleType, java.util.Locale locale)
-
msg
public java.lang.String msg(java.lang.String msgKey, java.lang.Object... msgArgs)Creates an I18N message using the key and arguments- Parameters:
msgKey- the key in the underlying message bundlemsgArgs- the message arguments- Returns:
- the formatted I18N message
-
msg
public java.lang.String msg(java.lang.String msgKey, java.util.List<java.lang.Object> msgArgs)Creates an I18N message using the key and arguments- Parameters:
msgKey- the key in the underlying message bundlemsgArgs- the message arguments- Returns:
- the formatted I18N message
-
-