public class LanguageImpl
extends Object
implements com.liferay.portal.kernel.language.Language, Serializable
You can disable translations by setting the
translations.disabled
property to true
in
portal.properties
.
Depending on the context passed into these methods, the lookup might be limited to the portal's resource bundle (e.g. when only a locale is passed), or extended to include an individual portlet's resource bundle (e.g. when a request object is passed). A portlet's resource bundle overrides the portal's resources when both are present.
Constructor and Description |
---|
LanguageImpl() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
com.liferay.portal.kernel.language.LanguageWrapper argument)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
com.liferay.portal.kernel.language.LanguageWrapper[] arguments)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
com.liferay.portal.kernel.language.LanguageWrapper[] arguments,
boolean translateArguments)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
com.liferay.portal.kernel.language.LanguageWrapper argument,
boolean translateArguments)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
Object argument)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
Object[] arguments)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
Object[] arguments,
boolean translateArguments)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(javax.servlet.http.HttpServletRequest request,
String pattern,
Object argument,
boolean translateArguments)
Returns the translated pattern using the current request's locale or, if
the current request locale is not available, the server's default locale.
|
String |
format(Locale locale,
String pattern,
List<Object> arguments)
Returns the translated pattern using the locale or, if the locale is not
available, the server's default locale.
|
String |
format(Locale locale,
String pattern,
Object argument)
Returns the translated pattern using the locale or, if the locale is not
available, the server's default locale.
|
String |
format(Locale locale,
String pattern,
Object[] arguments)
Returns the translated pattern using the locale or, if the locale is not
available, the server's default locale.
|
String |
format(Locale locale,
String pattern,
Object[] arguments,
boolean translateArguments)
Returns the translated pattern using the locale or, if the locale is not
available, the server's default locale.
|
String |
format(Locale locale,
String pattern,
Object argument,
boolean translateArguments)
Returns the translated pattern using the locale or, if the locale is not
available, the server's default locale.
|
String |
format(ResourceBundle resourceBundle,
String pattern,
Object argument)
Returns the translated pattern in the resource bundle or, if the resource
bundle is not available, the untranslated key.
|
String |
format(ResourceBundle resourceBundle,
String pattern,
Object[] arguments)
Returns the translated pattern in the resource bundle or, if the resource
bundle is not available, the untranslated key.
|
String |
format(ResourceBundle resourceBundle,
String pattern,
Object[] arguments,
boolean translateArguments)
Returns the translated pattern in the resource bundle or, if the resource
bundle is not available, the untranslated key.
|
String |
format(ResourceBundle resourceBundle,
String pattern,
Object argument,
boolean translateArguments)
Returns the translated pattern in the resource bundle or, if the resource
bundle is not available, the untranslated key.
|
String |
get(javax.servlet.http.HttpServletRequest request,
ResourceBundle resourceBundle,
String key)
Returns the key's translation from the portlet configuration, or from the
portal's resource bundle if the portlet configuration is unavailable.
|
String |
get(javax.servlet.http.HttpServletRequest request,
ResourceBundle resourceBundle,
String key,
String defaultValue) |
String |
get(javax.servlet.http.HttpServletRequest request,
String key) |
String |
get(javax.servlet.http.HttpServletRequest request,
String key,
String defaultValue)
Returns the key's translation from the portlet configuration, or from the
portal's resource bundle if the portlet configuration is unavailable.
|
String |
get(Locale locale,
String key)
Returns the key's translation from the portal's resource bundle.
|
String |
get(Locale locale,
String key,
String defaultValue)
Returns the key's translation from the portal's resource bundle.
|
String |
get(ResourceBundle resourceBundle,
String key)
Returns the key's translation from the resource bundle.
|
String |
get(ResourceBundle resourceBundle,
String key,
String defaultValue)
Returns the key's translation from the resource bundle.
|
Set<Locale> |
getAvailableLocales()
Returns the locales configured for the portal.
|
Set<Locale> |
getAvailableLocales(long groupId) |
String |
getBCP47LanguageId(javax.servlet.http.HttpServletRequest request) |
String |
getBCP47LanguageId(Locale locale) |
String |
getBCP47LanguageId(PortletRequest portletRequest) |
String |
getLanguageId(javax.servlet.http.HttpServletRequest request)
Returns the language ID that the request is served with.
|
String |
getLanguageId(Locale locale)
Returns the language ID from the locale.
|
String |
getLanguageId(PortletRequest portletRequest)
Returns the language ID that the
PortletRequest is served with. |
Locale |
getLocale(long groupId,
String languageCode) |
Locale |
getLocale(String languageCode)
Returns the locale associated with the language code.
|
com.liferay.portal.kernel.util.ResourceBundleLoader |
getPortalResourceBundleLoader() |
Set<Locale> |
getSupportedLocales() |
String |
getTimeDescription(javax.servlet.http.HttpServletRequest request,
long milliseconds)
Returns an exact localized description of the time interval (in
milliseconds) in the largest unit possible.
|
String |
getTimeDescription(javax.servlet.http.HttpServletRequest request,
Long milliseconds)
Returns an exact localized description of the time interval (in
milliseconds) in the largest unit possible.
|
String |
getTimeDescription(javax.servlet.http.HttpServletRequest request,
long milliseconds,
boolean approximate)
Returns an approximate or exact localized description of the time
interval (in milliseconds) in the largest unit possible.
|
String |
getTimeDescription(Locale locale,
long milliseconds)
Returns an exact localized description of the time interval (in
milliseconds) in the largest unit possible.
|
String |
getTimeDescription(Locale locale,
Long milliseconds)
Returns an exact localized description of the time interval (in
milliseconds) in the largest unit possible.
|
String |
getTimeDescription(Locale locale,
long milliseconds,
boolean approximate)
Returns an approximate or exact localized description of the time
interval (in milliseconds) in the largest unit possible.
|
void |
init() |
boolean |
isAvailableLanguageCode(String languageCode)
Returns
true if the language code is configured to be
available. |
boolean |
isAvailableLocale(Locale locale)
Returns
true if the locale is configured to be available. |
boolean |
isAvailableLocale(long groupId,
Locale locale)
Returns
true if the locale is configured to be available in
the group. |
boolean |
isAvailableLocale(long groupId,
String languageId)
Returns
true if the language ID is configured to be
available in the group. |
boolean |
isAvailableLocale(String languageId)
Returns
true if the language ID is configured to be
available. |
boolean |
isBetaLocale(Locale locale)
Returns
true if the locale is configured to be a beta
language. |
boolean |
isDuplicateLanguageCode(String languageCode) |
boolean |
isInheritLocales(long groupId) |
boolean |
isSameLanguage(Locale locale1,
Locale locale2) |
String |
process(ResourceBundle resourceBundle,
Locale locale,
String content) |
void |
resetAvailableGroupLocales(long groupId) |
void |
resetAvailableLocales(long companyId) |
void |
updateCookie(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Locale locale) |
public void afterPropertiesSet()
public String format(javax.servlet.http.HttpServletRequest request, String pattern, com.liferay.portal.kernel.language.LanguageWrapper argument)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.argument
- the single argument to be substituted into the pattern
and translated, if possiblepublic String format(javax.servlet.http.HttpServletRequest request, String pattern, com.liferay.portal.kernel.language.LanguageWrapper argument, boolean translateArguments)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.argument
- the single argument to be substituted into the pattern
and translated, if possibletranslateArguments
- whether the argument is translatedpublic String format(javax.servlet.http.HttpServletRequest request, String pattern, com.liferay.portal.kernel.language.LanguageWrapper[] arguments)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the pattern and
translated, if possiblepublic String format(javax.servlet.http.HttpServletRequest request, String pattern, com.liferay.portal.kernel.language.LanguageWrapper[] arguments, boolean translateArguments)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the patterntranslateArguments
- whether the arguments are translatedpublic String format(javax.servlet.http.HttpServletRequest request, String pattern, Object argument)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.argument
- the single argument to be substituted into the pattern
and translated, if possiblepublic String format(javax.servlet.http.HttpServletRequest request, String pattern, Object argument, boolean translateArguments)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.argument
- the single argument to be substituted into the pattern
and translated, if possibletranslateArguments
- whether the argument is translatedpublic String format(javax.servlet.http.HttpServletRequest request, String pattern, Object[] arguments)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the pattern and
translated, if possiblepublic String format(javax.servlet.http.HttpServletRequest request, String pattern, Object[] arguments, boolean translateArguments)
The lookup is done on the portlet configuration first, and if it's not found, it is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localepattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the patterntranslateArguments
- whether the arguments are translatedpublic String format(Locale locale, String pattern, List<Object> arguments)
The lookup is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to translate topattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the patternpublic String format(Locale locale, String pattern, Object argument)
The lookup is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to translate topattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.argument
- the argument to be substituted into the patternpublic String format(Locale locale, String pattern, Object argument, boolean translateArguments)
The lookup is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to translate topattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.argument
- the argument to be substituted into the patterntranslateArguments
- whether the argument is translatedpublic String format(Locale locale, String pattern, Object[] arguments)
The lookup is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to translate topattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the patternpublic String format(Locale locale, String pattern, Object[] arguments, boolean translateArguments)
The lookup is done on the portal's resource bundle. If a translation for a given key does not exist, this method returns the requested key as the translation.
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to translate topattern
- the key to look up in the current locale's resource file.
The key follows the standard Java resource specification.arguments
- the arguments to be substituted into the patterntranslateArguments
- whether the arguments are translatedpublic String format(ResourceBundle resourceBundle, String pattern, Object argument)
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
resourceBundle
- the requested key's resource bundlepattern
- the key to look up in the resource bundle. The key
follows the standard Java resource specification.argument
- the argument to be substituted into the patternpublic String format(ResourceBundle resourceBundle, String pattern, Object argument, boolean translateArguments)
The substitute placeholder (e.g. {0}
) is replaced with the
argument, following the standard Java ResourceBundle
notion of
index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
resourceBundle
- the requested key's resource bundlepattern
- the key to look up in the resource bundle. The key
follows the standard Java resource specification.argument
- the argument to be substituted into the patterntranslateArguments
- whether the argument is translatedpublic String format(ResourceBundle resourceBundle, String pattern, Object[] arguments)
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
resourceBundle
- the requested key's resource bundlepattern
- the key to look up in the resource bundle. The key
follows the standard Java resource specification.arguments
- the arguments to be substituted into the patternpublic String format(ResourceBundle resourceBundle, String pattern, Object[] arguments, boolean translateArguments)
The substitute placeholders (e.g. {0}
, {1}
,
{2}
, etc.) are replaced with the arguments, following the
standard Java ResourceBundle
notion of index based substitution.
format
in interface com.liferay.portal.kernel.language.Language
resourceBundle
- the requested key's resource bundlepattern
- the key to look up in the resource bundle. The key
follows the standard Java resource specification.arguments
- the arguments to be substituted into the patterntranslateArguments
- whether the arguments are translatedpublic String get(javax.servlet.http.HttpServletRequest request, ResourceBundle resourceBundle, String key)
get
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the key's context and
localeresourceBundle
- the requested key's resource bundlekey
- the translation keypublic String get(javax.servlet.http.HttpServletRequest request, ResourceBundle resourceBundle, String key, String defaultValue)
get
in interface com.liferay.portal.kernel.language.Language
public String get(javax.servlet.http.HttpServletRequest request, String key)
get
in interface com.liferay.portal.kernel.language.Language
public String get(javax.servlet.http.HttpServletRequest request, String key, String defaultValue)
get
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the key's context and
localekey
- the translation keydefaultValue
- the value to return if there is no matching
translationpublic String get(Locale locale, String key)
get
in interface com.liferay.portal.kernel.language.Language
locale
- the key's localekey
- the translation keypublic String get(Locale locale, String key, String defaultValue)
get
in interface com.liferay.portal.kernel.language.Language
locale
- the key's localekey
- the translation keydefaultValue
- the value to return if there is no matching
translationpublic String get(ResourceBundle resourceBundle, String key)
get
in interface com.liferay.portal.kernel.language.Language
resourceBundle
- the requested key's resource bundlekey
- the translation keypublic String get(ResourceBundle resourceBundle, String key, String defaultValue)
get
in interface com.liferay.portal.kernel.language.Language
resourceBundle
- the requested key's resource bundlekey
- the translation keydefaultValue
- the value to return if there is no matching
translationpublic Set<Locale> getAvailableLocales()
portal.properties
using the locales
and
locales.enabled
keys.getAvailableLocales
in interface com.liferay.portal.kernel.language.Language
public Set<Locale> getAvailableLocales(long groupId)
getAvailableLocales
in interface com.liferay.portal.kernel.language.Language
public String getBCP47LanguageId(javax.servlet.http.HttpServletRequest request)
getBCP47LanguageId
in interface com.liferay.portal.kernel.language.Language
public String getBCP47LanguageId(Locale locale)
getBCP47LanguageId
in interface com.liferay.portal.kernel.language.Language
public String getBCP47LanguageId(PortletRequest portletRequest)
getBCP47LanguageId
in interface com.liferay.portal.kernel.language.Language
public String getLanguageId(javax.servlet.http.HttpServletRequest request)
en
) or a specific
variant (e.g. en_GB
).getLanguageId
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the language IDpublic String getLanguageId(Locale locale)
en
) or a specific variant (e.g.
en_GB
).getLanguageId
in interface com.liferay.portal.kernel.language.Language
locale
- the locale used to determine the language IDpublic String getLanguageId(PortletRequest portletRequest)
PortletRequest
is served with.
The language ID is returned as a language code (e.g. en
) or
a specific variant (e.g. en_GB
).getLanguageId
in interface com.liferay.portal.kernel.language.Language
portletRequest
- the portlet request used to determine the language
IDpublic Locale getLocale(long groupId, String languageCode)
getLocale
in interface com.liferay.portal.kernel.language.Language
public Locale getLocale(String languageCode)
getLocale
in interface com.liferay.portal.kernel.language.Language
languageCode
- the code representation of a language (e.g.
en
and en_GB
)public com.liferay.portal.kernel.util.ResourceBundleLoader getPortalResourceBundleLoader()
getPortalResourceBundleLoader
in interface com.liferay.portal.kernel.language.Language
public Set<Locale> getSupportedLocales()
getSupportedLocales
in interface com.liferay.portal.kernel.language.Language
public String getTimeDescription(javax.servlet.http.HttpServletRequest request, long milliseconds)
For example, the following time intervals would be converted to the following time descriptions, using the English locale:
getTimeDescription
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localemilliseconds
- the time interval in milliseconds to describepublic String getTimeDescription(javax.servlet.http.HttpServletRequest request, long milliseconds, boolean approximate)
Approximate descriptions round the time to the largest possible unit and ignores the rest. For example, using the English locale:
Otherwise, exact descriptions would follow a similar conversion pattern as below:
getTimeDescription
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localemilliseconds
- the time interval in milliseconds to describeapproximate
- whether the time description is approximatepublic String getTimeDescription(javax.servlet.http.HttpServletRequest request, Long milliseconds)
For example, the following time intervals would be converted to the following time descriptions, using the English locale:
getTimeDescription
in interface com.liferay.portal.kernel.language.Language
request
- the request used to determine the current localemilliseconds
- the time interval in milliseconds to describepublic String getTimeDescription(Locale locale, long milliseconds)
For example, the following time intervals would be converted to the following time descriptions, using the English locale:
getTimeDescription
in interface com.liferay.portal.kernel.language.Language
locale
- the locale used to determine the languagemilliseconds
- the time interval in milliseconds to describepublic String getTimeDescription(Locale locale, long milliseconds, boolean approximate)
Approximate descriptions round the time to the largest possible unit and ignores the rest. For example, using the English locale:
Otherwise, exact descriptions would follow a similar conversion pattern as below:
getTimeDescription
in interface com.liferay.portal.kernel.language.Language
locale
- the locale used to determine the languagemilliseconds
- the time interval in milliseconds to describeapproximate
- whether the time description is approximatepublic String getTimeDescription(Locale locale, Long milliseconds)
For example, the following time intervals would be converted to the following time descriptions, using the English locale:
getTimeDescription
in interface com.liferay.portal.kernel.language.Language
locale
- the locale used to determine the languagemilliseconds
- the time interval in milliseconds to describepublic void init()
init
in interface com.liferay.portal.kernel.language.Language
public boolean isAvailableLanguageCode(String languageCode)
true
if the language code is configured to be
available. Locales can be configured in portal.properties
using the locales
and locales.enabled
keys.isAvailableLanguageCode
in interface com.liferay.portal.kernel.language.Language
languageCode
- the code representation of a language (e.g.
en
and en_GB
) to search fortrue
if the language code is configured to be
available; false
otherwisepublic boolean isAvailableLocale(Locale locale)
true
if the locale is configured to be available.
Locales can be configured in portal.properties
using the
locales
and locales.enabled
keys.isAvailableLocale
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to search fortrue
if the locale is configured to be available;
false
otherwisepublic boolean isAvailableLocale(long groupId, Locale locale)
true
if the locale is configured to be available in
the group.isAvailableLocale
in interface com.liferay.portal.kernel.language.Language
groupId
- the primary key of the grouplocale
- the locale to search fortrue
if the locale is configured to be available in
the group; false
otherwisepublic boolean isAvailableLocale(long groupId, String languageId)
true
if the language ID is configured to be
available in the group.isAvailableLocale
in interface com.liferay.portal.kernel.language.Language
groupId
- the primary key of the grouplanguageId
- the language ID to search fortrue
if the language ID is configured to be
available in the group; false
otherwisepublic boolean isAvailableLocale(String languageId)
true
if the language ID is configured to be
available.isAvailableLocale
in interface com.liferay.portal.kernel.language.Language
languageId
- the language ID to search fortrue
if the language ID is configured to be
available; false
otherwisepublic boolean isBetaLocale(Locale locale)
true
if the locale is configured to be a beta
language.isBetaLocale
in interface com.liferay.portal.kernel.language.Language
locale
- the locale to search fortrue
if the locale is configured to be a beta
language; false
otherwisepublic boolean isDuplicateLanguageCode(String languageCode)
isDuplicateLanguageCode
in interface com.liferay.portal.kernel.language.Language
public boolean isInheritLocales(long groupId) throws com.liferay.portal.kernel.exception.PortalException
isInheritLocales
in interface com.liferay.portal.kernel.language.Language
com.liferay.portal.kernel.exception.PortalException
public boolean isSameLanguage(Locale locale1, Locale locale2)
isSameLanguage
in interface com.liferay.portal.kernel.language.Language
public String process(ResourceBundle resourceBundle, Locale locale, String content)
process
in interface com.liferay.portal.kernel.language.Language
public void resetAvailableGroupLocales(long groupId)
resetAvailableGroupLocales
in interface com.liferay.portal.kernel.language.Language
public void resetAvailableLocales(long companyId)
resetAvailableLocales
in interface com.liferay.portal.kernel.language.Language
public void updateCookie(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale)
updateCookie
in interface com.liferay.portal.kernel.language.Language