org.pentaho.di.ui.i18n
Class TranslationsStore

java.lang.Object
  extended by 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
TranslationsStore(LogChannelInterface log, List<String> localeList, List<String> messagesPackages, String mainLocale, Map<String,List<KeyOccurrence>> packageOccurrences)
           
 
Method Summary
 MessagesStore findMainLocaleMessagesStore(String messagesPackage)
           
 List<MessagesStore> getChangedMessagesStores()
           
 List<String> getLocaleList()
           
 String getMainLocale()
           
 List<String> getMessagesPackages()
           
 List<MessagesStore> getMessagesStores(String searchLocale, String messagesPackage)
           
 Map<String,List<KeyOccurrence>> getPackageOccurrences()
           
 Map<String,LocaleStore> getTranslationsMap()
           
 String lookupKeyValue(String locale, String messagesPackage, String key)
          Look up the translation for a key in a certain locale
 void read(List<String> directories)
          Read all the translated messages for all the specified locale and all the specified locale
 void removeValue(String locale, String messagesPackage, String key)
           
 void setLocaleList(List<String> localeList)
           
 void setMainLocale(String mainLocale)
           
 void setMessagesPackages(List<String> messagesPackages)
           
 void setPackageOccurrences(Map<String,List<KeyOccurrence>> packageOccurrences)
           
 void setTranslationsMap(Map<String,LocaleStore> translationsMap)
           
 void storeValue(String locale, String messagesPackage, String key, String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslationsStore

public TranslationsStore(LogChannelInterface log,
                         List<String> localeList,
                         List<String> messagesPackages,
                         String mainLocale,
                         Map<String,List<KeyOccurrence>> packageOccurrences)
Parameters:
localeList -
messagesPackages -
map -
Method Detail

read

public void read(List<String> directories)
          throws 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:
KettleException

getLocaleList

public List<String> getLocaleList()
Returns:
the localeList

setLocaleList

public void setLocaleList(List<String> localeList)
Parameters:
localeList - the localeList to set

getMessagesPackages

public List<String> getMessagesPackages()
Returns:
the messagesPackages

setMessagesPackages

public void setMessagesPackages(List<String> messagesPackages)
Parameters:
messagesPackages - the messagesPackages to set

getTranslationsMap

public Map<String,LocaleStore> getTranslationsMap()
Returns:
the translationsMap

setTranslationsMap

public void setTranslationsMap(Map<String,LocaleStore> translationsMap)
Parameters:
translationsMap - the translationsMap 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 for
messagesPackage - the messages package to look in
key - the key
Returns:
the translation for the specified key in the desired locale, from the requested package

removeValue

public void removeValue(String locale,
                        String messagesPackage,
                        String key)

storeValue

public void storeValue(String locale,
                       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 messagesPackage)

getPackageOccurrences

public Map<String,List<KeyOccurrence>> getPackageOccurrences()
Returns:
the packageOccurrences

setPackageOccurrences

public void setPackageOccurrences(Map<String,List<KeyOccurrence>> packageOccurrences)
Parameters:
packageOccurrences - the packageOccurrences to set