OSID Logo
OSID Specifications
locale package
Version 3.0.0
Release Candidate Preview
Interfaceosid.locale.TranslationSession
Implementsosid.OsidSession
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.Typethe source language
CompliancemandatoryThis method must be implemented.
MethodgetSourceScriptType
Description

Gets the source script used in this session.

Returnosid.type.Typethe source script
CompliancemandatoryThis method must be implemented.
MethodgetTargetLanguageType
Description

Gets the target language used in this session.

Returnosid.type.Typethe target language
CompliancemandatoryThis method must be implemented.
MethodgetTargetScriptType
Description

Gets the target script used in this session.

Returnosid.type.Typethe target script
CompliancemandatoryThis 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
CompliancemandatoryThis method must be implemented.
MethodgetTranslation
Description

Translates the given string into the target language.

Parametersstringstringthe string to translate
Returnstringthe translated string
ErrorsNOT_FOUNDno translation found
NULL_ARGUMENT null argument provided
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodtranslateString
Description

Translates the given string into the target language.

Parametersstringstringthe string to translate
stringdefaultStringthe default string if no translation available.
Returnstringthe translated string or the given default value if no translation available.
ErrorsNULL_ARGUMENT null argument provided
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodtranslateStrings
Description

Translates the given strings into the target language.

Parametersstring[]stringsthe string to translate
string[]defaultStringsthe 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_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.