Package org.pentaho.di.ui.i18n
Class TranslationsStore
- java.lang.Object
-
- org.pentaho.di.ui.i18n.TranslationsStore
-
public class TranslationsStore extends Object
This class contains and handles all the translations for the keys specified in the Java source code.- Author:
- matt
-
-
Constructor Summary
Constructors Constructor Description TranslationsStore(org.pentaho.di.core.logging.LogChannelInterface log, List<String> localeList, String mainLocale, Map<String,Map<String,List<KeyOccurrence>>> sourcePackageOccurrences)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessagesStore
findMainLocaleMessagesStore(String sourceFolder, String messagesPackage)
List<MessagesStore>
getChangedMessagesStores()
List<String>
getLocaleList()
String
getMainLocale()
List<MessagesStore>
getMessagesStores(String searchLocale, String messagesPackage)
Map<String,Map<String,List<KeyOccurrence>>>
getSourcePackageOccurrences()
String
lookupKeyValue(String locale, String messagesPackage, String key)
Look up the translation for a key in a certain localevoid
read(List<String> directories)
Read all the translated messages for all the specified locale and all the specified localevoid
removeValue(String locale, String sourceFolder, String messagesPackage, String key)
void
setLocaleList(List<String> localeList)
void
setMainLocale(String mainLocale)
void
setSourcePackageOccurrences(Map<String,Map<String,List<KeyOccurrence>>> sourcePackageOccurrences)
void
storeValue(String locale, String sourceFolder, String messagesPackage, String key, String value)
-
-
-
Method Detail
-
read
public void read(List<String> directories) throws org.pentaho.di.core.exception.KettleException
Read all the translated messages for all the specified locale and all the specified locale- Parameters:
directories
- The reference source directories to search packages in- Throws:
org.pentaho.di.core.exception.KettleException
-
setLocaleList
public void setLocaleList(List<String> localeList)
- Parameters:
localeList
- the localeList to set
-
getMainLocale
public String getMainLocale()
- Returns:
- the mainLocale
-
setMainLocale
public void setMainLocale(String mainLocale)
- Parameters:
mainLocale
- the mainLocale to set
-
lookupKeyValue
public String lookupKeyValue(String locale, String messagesPackage, String key)
Look up the translation for a key in a certain locale- Parameters:
locale
- the locale to hunt forsourceFolder
- the source folder to look inmessagesPackage
- the messages package to look inkey
- the key- Returns:
- the translation for the specified key in the desired locale, from the requested package
-
removeValue
public void removeValue(String locale, String sourceFolder, String messagesPackage, String key)
-
storeValue
public void storeValue(String locale, String sourceFolder, String messagesPackage, String key, String value)
-
getChangedMessagesStores
public List<MessagesStore> getChangedMessagesStores()
- Returns:
- the list of changed messages stores.
-
getMessagesStores
public List<MessagesStore> getMessagesStores(String searchLocale, String messagesPackage)
- Parameters:
searchLocale
- the locale the filter on.messagesPackage
- the messagesPackage to filter on. Specify null to get all message stores.- Returns:
- the list of messages stores for the main locale
-
findMainLocaleMessagesStore
public MessagesStore findMainLocaleMessagesStore(String sourceFolder, String messagesPackage)
-
getSourcePackageOccurrences
public Map<String,Map<String,List<KeyOccurrence>>> getSourcePackageOccurrences()
-
-