| Interface | osid.locale.TranslationSession | ||
|---|---|---|---|
| Implements | osid.OsidSession | ||
| Description | 
                 This session defines methods to translate text between a source and target locale.  | ||
| Method | getSourceLanguageType | ||
| Description | 
                     Gets the source language used in this session.  | ||
| Return | osid.type.Type | the source language | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getSourceScriptType | ||
| Description | 
                     Gets the source script used in this session.  | ||
| Return | osid.type.Type | the source script | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getTargetLanguageType | ||
| Description | 
                     Gets the target language used in this session.  | ||
| Return | osid.type.Type | the target language | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getTargetScriptType | ||
| Description | 
                     Gets the target script used in this session.  | ||
| Return | osid.type.Type | the target script | |
| Compliance | mandatory | This method must be implemented. | |
| Method | canTranslate | ||
| 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   | ||
| Return | boolean |  false  if translation methods are not authorized,  true 
 otherwise  | |
| Compliance | mandatory | This method must be implemented. | |
| Method | getTranslation | ||
| Description | 
                     Translates the given string into the target language.  | ||
| Parameters | string | string | the  string  to translate  | 
| Return | string | the translated  string   | |
| Errors | NOT_FOUND | no translation found | |
| NULL_ARGUMENT |  null  argument provided  |                 ||
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | translateString | ||
| Description | 
                     Translates the given string into the target language.  | ||
| Parameters | string | string | the  string  to translate  | 
string | defaultString | the default  string  if no translation available.  | |
| Return | string | the translated  string  or the given default value if no 
translation available.  | |
| Errors | NULL_ARGUMENT |  null  argument provided  |                 |
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |
| Method | translateStrings | ||
| Description | 
                     Translates the given strings into the target language.  | ||
| Parameters | string[] | strings | the  string  to translate  | 
string[] | defaultStrings | the default  string  if no translation available.  | |
| Return | string[] | the translated  strings  or the given default value if no 
translation available.  | |
| Errors | NULL_ARGUMENT |  null  argument provided  |                 |
| OPERATION_FAILED | unable to complete request | ||
| PERMISSION_DENIED | authorization failure | ||
| Compliance | mandatory | This method must be implemented. | |