Package org.eclipse.e4.ui.model
Class LocalizationHelper
java.lang.Object
org.eclipse.e4.ui.model.LocalizationHelper
This class provides set of utility method that can be useful in typical
localization scenarios.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getLocalized
(String key, MApplicationElement element) Returns localized string for the key using locale information specified in the element's context.static String
getLocalized
(String key, MApplicationElement element, IEclipseContext context) Returns localized string for the key from the application element using translation service from the context.static String
Returns localized accessibilityPhrase for the specified element using locale information from its context.static String
getLocalizedFeature
(org.eclipse.emf.ecore.EStructuralFeature feature, MApplicationElement element) static String
getLocalizedLabel
(MUIElement element) Returns localized label for the specified element using locale information from its context.static String
getLocalizedTooltip
(MUIElement element) Returns localized tooltip for the specified element using locale information from its context.
-
Method Details
-
getLocalizedFeature
public static String getLocalizedFeature(org.eclipse.emf.ecore.EStructuralFeature feature, MApplicationElement element) -
getLocalizedAccessibilityPhrase
Returns localized accessibilityPhrase for the specified element using locale information from its context.- Parameters:
element
- the element- Returns:
- localized element's accessibilityPhrase, or
null
if no label can be found
-
getLocalizedLabel
Returns localized label for the specified element using locale information from its context.- Parameters:
element
- the element- Returns:
- localized element's label, or
null
if no label can be found
-
getLocalizedTooltip
Returns localized tooltip for the specified element using locale information from its context.- Parameters:
element
- the element- Returns:
- localized element's tooltip, or
null
if no tooltip can be found
-
getLocalized
Returns localized string for the key using locale information specified in the element's context.This method will return the key itself if the context can not be found for the model element or there is no translation service registered in that context.
- Parameters:
key
- the keyelement
- the model element- Returns:
- localized key
-
getLocalized
Returns localized string for the key from the application element using translation service from the context.This method will return the key itself if the context is
null
or there is no translation service registered in the given context.- Parameters:
key
- the keyelement
- the model elementcontext
- the context- Returns:
- localized key
-