OSID Logo
OSID Specifications
locale package
Version 3.1.0
Interfaceosid.locale.TranslationSession
Implementsosid.OsidSession
Used Byosid.locale.LocaleManager
osid.locale.LocaleProxyManager
Description

This session defines methods to translate text between a source and target locale.

MethodgetSourceLanguageType
Description

Gets the source language used in this session.

Returnosid.type.Type the source language
Compliancemandatory This method must be implemented.
MethodgetSourceScriptType
Description

Gets the source script used in this session.

Returnosid.type.Type the source script
Compliancemandatory This method must be implemented.
MethodgetTargetLanguageType
Description

Gets the target language used in this session.

Returnosid.type.Type the target language
Compliancemandatory This method must be implemented.
MethodgetTargetScriptType
Description

Gets the target script used in this session.

Returnosid.type.Type the target script
Compliancemandatory This method must be implemented.
MethodcanTranslate
Description

Tests if this user can perform language translations. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.

Returnboolean false if translation methods are not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetTranslation
Description

Translates the given string into the target language.

Parametersstringstring the string to translate
Returnstring the translated string
ErrorsNOT_FOUND no translation found
NULL_ARGUMENT null argument provided
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodtranslateString
Description

Translates the given string into the target language.

Parametersstringstring the string to translate
stringdefaultString the default string if no translation available.
Returnstring the translated string or the given default value if no translation available.
ErrorsNULL_ARGUMENT null argument provided
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodtranslateStrings
Description

Translates the given strings into the target language.

Parametersstring[]strings the string to translate
string[]defaultStrings the default string if no translation available.
Returnstring[] the translated strings or the given default value if no translation available.
ErrorsNULL_ARGUMENT null argument provided
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.