Class TranslationProvider
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.i18n.TranslationProvider
-
public class TranslationProvider extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringapplicationprotected RDFServicerdfService
-
Constructor Summary
Constructors Constructor Description TranslationProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()static TranslationProvidergetInstance()StringgetTranslation(List<String> preferredLocales, String key, Object[] parameters)voidinitialize(javax.servlet.ServletContext ctx)static StringpreprocessForFormating(String inputText)This method should prepare the inputText for MessageFormat.format method.voidsetTheme(String theme)
-
-
-
Field Detail
-
rdfService
protected RDFService rdfService
-
application
protected String application
-
-
Method Detail
-
getInstance
public static TranslationProvider getInstance()
-
initialize
public void initialize(javax.servlet.ServletContext ctx)
-
setTheme
public void setTheme(String theme)
-
getTranslation
public String getTranslation(List<String> preferredLocales, String key, Object[] parameters)
-
preprocessForFormating
public static String preprocessForFormating(String inputText)
This method should prepare the inputText for MessageFormat.format method. At the moment it is replacing single apostrophe with double, it might be extented in the future with some additional preprocessing.- Parameters:
inputText- - string which should be preprocessed- Returns:
- preprocessed input string, i.e. string with replaced single apostrophe with double
-
clearCache
public void clearCache()
-
-