Class LanguageUtil
Object
com.liferay.portal.kernel.language.LanguageUtil
- Author:
- Brian Wing Shun Chan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
static String
static String
static String
static String
format
(ResourceBundle resourceBundle, String pattern, Object argument) static String
format
(ResourceBundle resourceBundle, String pattern, Object[] arguments) static String
format
(ResourceBundle resourceBundle, String pattern, Object[] arguments, boolean translateArguments) static String
format
(ResourceBundle resourceBundle, String pattern, Object argument, boolean translateArguments) static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper argument) static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper[] arguments) static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper[] arguments, boolean translateArguments) static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper argument, boolean translateArguments) static String
static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, Object[] arguments) static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, Object[] arguments, boolean translateArguments) static String
format
(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, Object argument, boolean translateArguments) static String
formatStorageSize
(double size, Locale locale) static String
static String
static String
get
(ResourceBundle resourceBundle, String key) static String
get
(ResourceBundle resourceBundle, String key, String defaultValue) static String
static String
static String
get
(javax.servlet.http.HttpServletRequest httpServletRequest, ResourceBundle resourceBundle, String key) static String
get
(javax.servlet.http.HttpServletRequest httpServletRequest, ResourceBundle resourceBundle, String key, String defaultValue) getAvailableLocales
(long groupId) static String
getBCP47LanguageId
(Locale locale) static String
getBCP47LanguageId
(PortletRequest portletRequest) static String
getBCP47LanguageId
(javax.servlet.http.HttpServletRequest httpServletRequest) getCompanyAvailableLocales
(long companyId) static Language
static String
getLanguageId
(Locale locale) static String
getLanguageId
(PortletRequest portletRequest) static String
getLanguageId
(javax.servlet.http.HttpServletRequest httpServletRequest) static long
static Locale
static Locale
static ResourceBundleLoader
static String
getTimeDescription
(Locale locale, long milliseconds) static String
getTimeDescription
(Locale locale, long milliseconds, boolean approximate) static String
getTimeDescription
(Locale locale, Long milliseconds) static String
getTimeDescription
(javax.servlet.http.HttpServletRequest httpServletRequest, long milliseconds) static String
getTimeDescription
(javax.servlet.http.HttpServletRequest httpServletRequest, long milliseconds, boolean approximate) static String
getTimeDescription
(javax.servlet.http.HttpServletRequest httpServletRequest, Long milliseconds) static void
init()
static boolean
isAvailableLanguageCode
(String languageCode) static boolean
isAvailableLocale
(long groupId, String languageId) static boolean
isAvailableLocale
(long groupId, Locale locale) static boolean
isAvailableLocale
(String languageId) static boolean
isAvailableLocale
(Locale locale) static boolean
isBetaLocale
(Locale locale) static boolean
isDuplicateLanguageCode
(String languageCode) static boolean
isInheritLocales
(long groupId) static boolean
isSameLanguage
(Locale locale1, Locale locale2) static String
process
(Supplier<ResourceBundle> resourceBundleSupplier, Locale locale, String content) static void
resetAvailableGroupLocales
(long groupId) static void
resetAvailableLocales
(long companyId) void
setLanguage
(Language language) static void
updateCookie
(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, Locale locale)
-
Constructor Details
-
LanguageUtil
public LanguageUtil()
-
-
Method Details
-
format
public static String format(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper argument) -
format
public static String format(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper argument, boolean translateArguments) -
format
public static String format(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper[] arguments) -
format
public static String format(javax.servlet.http.HttpServletRequest httpServletRequest, String pattern, LanguageWrapper[] arguments, boolean translateArguments) -
format
-
format
-
format
-
format
-
format
-
format
-
format
-
format
-
format
-
format
-
format
public static String format(ResourceBundle resourceBundle, String pattern, Object argument, boolean translateArguments) -
format
-
format
public static String format(ResourceBundle resourceBundle, String pattern, Object[] arguments, boolean translateArguments) -
formatStorageSize
-
get
public static String get(javax.servlet.http.HttpServletRequest httpServletRequest, ResourceBundle resourceBundle, String key) -
get
public static String get(javax.servlet.http.HttpServletRequest httpServletRequest, ResourceBundle resourceBundle, String key, String defaultValue) -
get
-
get
-
get
-
get
-
get
-
get
-
getAvailableLocales
-
getAvailableLocales
-
getBCP47LanguageId
-
getBCP47LanguageId
-
getBCP47LanguageId
-
getCompanyAvailableLocales
-
getLanguage
-
getLanguageId
-
getLanguageId
-
getLanguageId
-
getLastModified
public static long getLastModified() -
getLocale
-
getLocale
-
getResourceBundleLoader
-
getSupportedLocales
-
getTimeDescription
public static String getTimeDescription(javax.servlet.http.HttpServletRequest httpServletRequest, long milliseconds) -
getTimeDescription
public static String getTimeDescription(javax.servlet.http.HttpServletRequest httpServletRequest, long milliseconds, boolean approximate) -
getTimeDescription
-
getTimeDescription
-
getTimeDescription
-
getTimeDescription
-
init
public static void init() -
isAvailableLanguageCode
-
isAvailableLocale
-
isAvailableLocale
-
isAvailableLocale
-
isAvailableLocale
-
isBetaLocale
-
isDuplicateLanguageCode
-
isInheritLocales
- Throws:
PortalException
-
isSameLanguage
-
process
public static String process(Supplier<ResourceBundle> resourceBundleSupplier, Locale locale, String content) -
resetAvailableGroupLocales
public static void resetAvailableGroupLocales(long groupId) -
resetAvailableLocales
public static void resetAvailableLocales(long companyId) -
updateCookie
public static void updateCookie(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, Locale locale) -
setLanguage
-