@robinpath/translate
0.1.1Node.jsPublicTranslate module for RobinPath.
Translate
Translate module for RobinPath.
Package: @robinpath/translate | Category: Ai | Type: Integration
Authentication
No authentication required. All functions are available immediately.
Use Cases
Use the translate module when you need to:
- translateText -- Use
translate.translateTextto perform this operation - translateBatch -- Use
translate.translateBatchto perform this operation - detectLanguage -- Use
translate.detectLanguageto perform this operation - listLanguages -- Use
translate.listLanguagesto perform this operation - getSupportedLanguagePairs -- Use
translate.getSupportedLanguagePairsto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
translateText | translateText | object |
translateBatch | translateBatch | object |
detectLanguage | detectLanguage | object |
listLanguages | listLanguages | object |
getSupportedLanguagePairs | getSupportedLanguagePairs | object |
translateHtml | translateHtml | object |
suggestTranslation | suggestTranslation | object |
getTranslationMemory | getTranslationMemory | object |
autoTranslate | autoTranslate | object |
setProvider | setProvider | object |
Functions
translateText
translateText
Module: translate | Returns: object -- API response.
translate.translateText
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
translateBatch
translateBatch
Module: translate | Returns: object -- API response.
translate.translateBatch
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
detectLanguage
detectLanguage
Module: translate | Returns: object -- API response.
translate.detectLanguage
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
listLanguages
listLanguages
Module: translate | Returns: object -- API response.
translate.listLanguages
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getSupportedLanguagePairs
getSupportedLanguagePairs
Module: translate | Returns: object -- API response.
translate.getSupportedLanguagePairs
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
translateHtml
translateHtml
Module: translate | Returns: object -- API response.
translate.translateHtml
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
suggestTranslation
suggestTranslation
Module: translate | Returns: object -- API response.
translate.suggestTranslation
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
getTranslationMemory
getTranslationMemory
Module: translate | Returns: object -- API response.
translate.getTranslationMemory
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
autoTranslate
autoTranslate
Module: translate | Returns: object -- API response.
translate.autoTranslate
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
setProvider
setProvider
Module: translate | Returns: object -- API response.
translate.setProvider
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | No | Input parameter |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Translate API error (${res.status}): ${t} | Check the error message for details |
Translate: "..." not configured. Call translate.setCredentials first. | Check the error message for details |
@desc "Translate text and validate result"
do
set $result as translate.translateText
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Languages
Retrieve all items and loop through them.
@desc "List languages and iterate results"
do
set $result as translate.listLanguages
each $item in $result
print $item
end
enddo
2. Multi-step Translate workflow
Chain multiple translate operations together.
@desc "Translate text, translate batch, and more"
do
set $r_translateText as translate.translateText
set $r_translateBatch as translate.translateBatch
set $r_detectLanguage as translate.detectLanguage
print "All operations complete"
enddo
3. Safe translateText with validation
Check results before proceeding.
@desc "Translate text and validate result"
do
set $result as translate.translateText
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- openai -- OpenAI module for complementary functionality
- anthropic -- Anthropic module for complementary functionality
- ai -- AI module for complementary functionality
- deepl -- DeepL module for complementary functionality
- json -- JSON module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
$ robinpath add @robinpath/translate
