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 class
I18n.BundleType
This enum is a type safe way to control what resource bundle to load from
-
Constructor Summary
Constructors Modifier Constructor Description protected
I18n(I18n.BundleType bundleType, java.util.Locale locale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Locale
getLocale()
java.util.ResourceBundle
getResourceBundle()
static I18n
i18n(I18n.BundleType bundleType, java.util.Locale locale)
java.lang.String
msg(java.lang.String msgKey, java.lang.Object... msgArgs)
Creates an I18N message using the key and argumentsjava.lang.String
msg(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
-
-