public interface TranslationSession extends OsidSession
This session defines methods to translate text between a source and target locale.
Modifier and Type | Method and Description |
---|---|
boolean |
canTranslate()
Tests if this user can perform language translations.
|
Type |
getSourceLanguageType()
Gets the source language used in this session.
|
Type |
getSourceScriptType()
Gets the source script used in this session.
|
Type |
getTargetLanguageType()
Gets the target language used in this session.
|
Type |
getTargetScriptType()
Gets the target script used in this session.
|
java.lang.String |
getTranslation(java.lang.String string)
Translates the given string into the target language.
|
java.lang.String |
translateString(java.lang.String string,
java.lang.String defaultString)
Translates the given string into the target language.
|
java.lang.String[] |
translateStrings(java.lang.String[] strings,
java.lang.String[] defaultStrings)
Translates the given strings into the target language.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Type getSourceLanguageType()
mandatory
- This method must be implemented. Type getSourceScriptType()
mandatory
- This method must be implemented. Type getTargetLanguageType()
mandatory
- This method must be implemented. Type getTargetScriptType()
mandatory
- This method must be implemented. boolean canTranslate()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer lookup operations. false
if translation methods are not
authorized, true
otherwisemandatory
- This method must be implemented. java.lang.String getTranslation(java.lang.String string) throws NotFoundException, OperationFailedException, PermissionDeniedException
string
- the string
to translate string
NotFoundException
- no translation foundNullArgumentException
- null
argument
providedOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. java.lang.String translateString(java.lang.String string, java.lang.String defaultString) throws OperationFailedException, PermissionDeniedException
string
- the string
to translatedefaultString
- the default string
if no
translation available. string
or the given default
value if no translation available.NullArgumentException
- null
argument
providedOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. java.lang.String[] translateStrings(java.lang.String[] strings, java.lang.String[] defaultStrings) throws OperationFailedException, PermissionDeniedException
strings
- the string
to translatedefaultStrings
- the default string
if no
translation available. strings
or the given default
value if no translation available.NullArgumentException
- null
argument
providedOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.