Package com.e1c.langtool.generatestring
Interface TranslationStringsGenerator
- All Known Implementing Classes:
ProjectGenerateTranslationStrings,ProjectObjectsGenerateTranslationStrings,TranslatedObjectImportTranslationStrings,TranslatedProjectImportTranslationStrings
public interface TranslationStringsGenerator
Common tool to generate translation strings and store them to some storage.
Supports various settings how to collect and fill strings from source project.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddLanguage(TranslateLanguage language) Adds the language to collect and to save.voidaddOrUpdateValue(FeatureValue value) Adds the or update value.booleanchecks if can process collecting and saving translation strings..booleanCheck settings.voidcollectAndSaveStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect and save strings.booleancollectStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect translation strings.voidvoiddispose()Dispose and free held resources.voidGets the collected values.Checks if should to collect computed strings.Gets the errors that found during collecting features.Gets the fill up type.Return the languages that should be collected and saved.org.eclipse.core.resources.IProjectGets the project of collection.Gets the storage id.Gets the translating project.Gets the translation provider id.booleanChecks if the translations need to check exists in any available storage.booleanChecks if should to collect interface strings.booleanChecks if should to collect model strings.booleanChecks if the collecting process should continue after first error.voidremoveLanguage(TranslateLanguage language) Removes the language from collecting languages.voidsaveCollectedStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Save collected strings.voidsetCheckTranslationsInAnyAvailableStorage(boolean checkTranslationsInAnyAvailableStorage) Sets the check translations in any available storage.voidsetCollectInterfaceStrings(boolean collectInterfaceStrings) Sets to collect interface strings.voidsetCollectModelStrings(boolean collectModelStrings) Sets to collect model strings.voidsetCollectModelType(ICollectingParameters.CollectModelType collectModelType) Sets to collect computed strings.voidsetContinueAfterFirstError(boolean isContinue) Sets whether to continue collect after first error.voidsetFillUpType(FillUpType fillUpType) Sets the fill up type.voidsetFilterParameters(Map<String, ? extends Object> filterParameters) Sets the filter parameters.voidsetLanguages(List<TranslateLanguage> languages) Sets the languages to collect and to save.voidsetStorageId(StorageID storageId) Sets the storage id.voidsetTranslatingProject(ITranslatingProject translatingProject) Sets the translating project.voidsetTranslationProviderId(String providerId) Sets the translation provider id.
-
Method Details
-
getTranslatingProject
ITranslatingProject getTranslatingProject()Gets the translating project.- Returns:
- the translating project, can return
null.
-
setTranslatingProject
Sets the translating project.- Parameters:
translatingProject- the new translating project
-
checkSettings
boolean checkSettings()Check settings. If checking is unsuccessful get errorsgetErrors()to show details to user.- Returns:
- true, checks of settings if successful
-
setFilterParameters
Sets the filter parameters.- Parameters:
filterParameters- the filter parameters, where key is public filter's parameter name and value, usually string or other object appropriate for the filter participant passed form a caller, cannot benull.
-
addOrUpdateValue
Adds the or update value.- Parameters:
value- the value, cannot benull.
-
collectAndSaveStrings
void collectAndSaveStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect and save strings.- Parameters:
monitor- the monitor, cannot benull.
-
dispose
void dispose()Dispose and free held resources. -
saveCollectedStrings
void saveCollectedStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Save collected strings.- Parameters:
monitor- the monitor, cannot benull.
-
collectStrings
boolean collectStrings(org.eclipse.core.runtime.IProgressMonitor monitor) Collect translation strings.- Parameters:
monitor- the monitor, cannot benull.- Returns:
- true, if successfully collected and filled with settings
-
getErrors
Collection<Exception> getErrors()Gets the errors that found during collecting features.- Returns:
- the errors, cannot return
null.
-
canProcess
boolean canProcess()checks if can process collecting and saving translation strings..- Returns:
- true, if can process collecting and saving translation strings.
-
isContinueAfterFirstError
boolean isContinueAfterFirstError()Checks if the collecting process should continue after first error.- Returns:
- true, if the collecting process should continue after first error
-
setContinueAfterFirstError
void setContinueAfterFirstError(boolean isContinue) Sets whether to continue collect after first error.- Parameters:
isContinue- true, to continue after first error
-
getCollectedValues
Collection<FeatureValue> getCollectedValues()Gets the collected values.- Returns:
- the collected values collecting and saving translation strings, cannot return
null.
-
getTranslationProviderId
String getTranslationProviderId()Gets the translation provider id.- Returns:
- the translation provider id, can return
nullif not set.
-
setTranslationProviderId
Sets the translation provider id.- Parameters:
providerId- the new translation provider id, cannot benull.
-
setCheckTranslationsInAnyAvailableStorage
void setCheckTranslationsInAnyAvailableStorage(boolean checkTranslationsInAnyAvailableStorage) Sets the check translations in any available storage.- Parameters:
checkTranslationsInAnyAvailableStorage- the new check translations in any available storage
-
isCheckTranslationsInAnyAvailableStorage
boolean isCheckTranslationsInAnyAvailableStorage()Checks if the translations need to check exists in any available storage.- Returns:
- true, if it need to check translations in any available storage
-
setFillUpType
Sets the fill up type.- Parameters:
fillUpType- the new fill up type, cannot benull.
-
getFillUpType
FillUpType getFillUpType()Gets the fill up type. Default isFillUpType.NOT_FILLUPnot fill up.- Returns:
- the fillUpType, cannot return
null.
-
setStorageId
Sets the storage id.- Parameters:
storageId- the new storage id, cannot benull.
-
getStorageId
StorageID getStorageId()Gets the storage id.- Returns:
- the storage id, cannot return
null.
-
setCollectModelType
Sets to collect computed strings.- Parameters:
collectComputedStrings- the new collect computed strings
-
getCollectModelType
ICollectingParameters.CollectModelType getCollectModelType()Checks if should to collect computed strings.- Returns:
- true, if should collect computed strings
-
setCollectInterfaceStrings
void setCollectInterfaceStrings(boolean collectInterfaceStrings) Sets to collect interface strings.- Parameters:
collectInterfaceStrings- the new collect interface strings
-
isCollectInterfaceStrings
boolean isCollectInterfaceStrings()Checks if should to collect interface strings.- Returns:
- true, if should collect interface strings
-
setCollectModelStrings
void setCollectModelStrings(boolean collectModelStrings) Sets to collect model strings.- Parameters:
collectModelStrings- the new collect model strings
-
isCollectModelStrings
boolean isCollectModelStrings()Checks if should to collect model strings.- Returns:
- true, if should collect model strings
-
getProject
org.eclipse.core.resources.IProject getProject()Gets the project of collection.- Returns:
- the project, cannot be
null.
-
removeLanguage
Removes the language from collecting languages.- Parameters:
language- the language, cannot benull.
-
addLanguage
Adds the language to collect and to save.- Parameters:
language- the language, cannot benull.
-
setLanguages
Sets the languages to collect and to save.- Parameters:
languages- the new languages, cannot benull.
-
getLanguages
List<TranslateLanguage> getLanguages()Return the languages that should be collected and saved.- Returns:
- the languages, cannot return
null.
-
disableCache
void disableCache() -
enableCache
void enableCache()
-