KosmoKrator

productivity

Google Translate Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Google Translate KosmoKrator integration.

7 functions 5 read 2 write API key auth

Lua Namespace

Agents call this integration through app.integrations.google_translate.*. Use lua_read_doc("integrations.google-translate") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Google Translate Integration

Tools

google_translate_translate_text

Translate text using Google Cloud Translation.

Parameters:

  • text (string, required) — The text to translate.
  • target (string, required) — Target language code (e.g., “en”, “de”, “fr”, “es”, “ja”, “zh”).
  • source (string, optional) — Source language code. Auto-detected if omitted.
  • format (string, optional) — Text format: “text” (plain text, default) or “html”.

google_translate_detect_language

Detect the language of text.

Parameters:

  • text (string, required) — The text to detect the language of.

google_translate_list_supported_languages

List languages supported by Google Cloud Translation.

Parameters:

  • target (string, optional) — Target language code for localizing language names (e.g., “en”).

google_translate_list_glossaries

List all glossaries.

Parameters: None.

google_translate_get_glossary

Get details of a specific glossary.

Parameters:

  • name (string, required) — The glossary resource name (e.g., “projects/PROJECT_ID/locations/LOCATION/glossaries/GLOSSARY_ID”).

google_translate_create_glossary

Create a new glossary.

Parameters:

  • name (string, required) — The glossary resource name.
  • source_lang (string, required) — Source language code.
  • target_lang (string, required) — Target language code.
  • entries (array, required) — Array of term pairs with “source” and “target” keys.

google_translate_get_current_user

Verify the API key and get connection information.

Parameters: None.

Raw agent markdown
# Google Translate Integration

## Tools

### google_translate_translate_text
Translate text using Google Cloud Translation.

**Parameters:**
- `text` (string, required) — The text to translate.
- `target` (string, required) — Target language code (e.g., "en", "de", "fr", "es", "ja", "zh").
- `source` (string, optional) — Source language code. Auto-detected if omitted.
- `format` (string, optional) — Text format: "text" (plain text, default) or "html".

### google_translate_detect_language
Detect the language of text.

**Parameters:**
- `text` (string, required) — The text to detect the language of.

### google_translate_list_supported_languages
List languages supported by Google Cloud Translation.

**Parameters:**
- `target` (string, optional) — Target language code for localizing language names (e.g., "en").

### google_translate_list_glossaries
List all glossaries.

**Parameters:** None.

### google_translate_get_glossary
Get details of a specific glossary.

**Parameters:**
- `name` (string, required) — The glossary resource name (e.g., "projects/PROJECT_ID/locations/LOCATION/glossaries/GLOSSARY_ID").

### google_translate_create_glossary
Create a new glossary.

**Parameters:**
- `name` (string, required) — The glossary resource name.
- `source_lang` (string, required) — Source language code.
- `target_lang` (string, required) — Target language code.
- `entries` (array, required) — Array of term pairs with "source" and "target" keys.

### google_translate_get_current_user
Verify the API key and get connection information.

**Parameters:** None.

Metadata-Derived Lua Example

local result = app.integrations.google_translate.google_translate_translate_text({
  text = "example_text",
  target = "example_target",
  source = "example_source",
  format = "example_format"
})
print(result)

Functions

google_translate_translate_text

Translate text using Google Cloud Translation. Supports automatic source language detection or explicit source language specification. Returns translated text with detected source language.

Operation
Write write
Full name
google-translate.google_translate_translate_text
ParameterTypeRequiredDescription
text string yes The text to translate.
target string yes The target language code (e.g., "en", "de", "fr", "es", "ja", "zh").
source string no The source language code (e.g., "en", "de"). If omitted, Google auto-detects the source language.
format string no Text format: "text" (plain text, default) or "html" (HTML markup).

google_translate_detect_language

Detect the language of text using Google Cloud Translation. Returns detected language codes and confidence scores.

Operation
Read read
Full name
google-translate.google_translate_detect_language
ParameterTypeRequiredDescription
text string yes The text to detect the language of.

google_translate_list_supported_languages

List languages supported by Google Cloud Translation. Returns language codes and names. Optionally specify a target language to localize language names.

Operation
Read read
Full name
google-translate.google_translate_list_supported_languages
ParameterTypeRequiredDescription
target string no Target language code for localizing language names (e.g., "en" for English names, "fr" for French names). If omitted, only language codes are returned.

google_translate_list_glossaries

List all glossaries in your Google Cloud Translation project. Returns glossary names, language pairs, and entry counts.

Operation
Read read
Full name
google-translate.google_translate_list_glossaries
ParameterTypeRequiredDescription
No parameters.

google_translate_get_glossary

Get details of a specific Google Cloud Translation glossary by name. Returns glossary name, language pair, entry count, and timestamps.

Operation
Read read
Full name
google-translate.google_translate_get_glossary
ParameterTypeRequiredDescription
name string yes The glossary resource name (e.g., "projects/PROJECT_ID/locations/LOCATION/glossaries/GLOSSARY_ID").

google_translate_create_glossary

Create a new Google Cloud Translation glossary. Glossaries define custom translations for specific terms. Provide term pairs as an array of source/target strings.

Operation
Write write
Full name
google-translate.google_translate_create_glossary
ParameterTypeRequiredDescription
name string yes The glossary resource name (e.g., "projects/PROJECT_ID/locations/LOCATION/glossaries/my-glossary").
source_lang string yes The source language code (e.g., "en", "de").
target_lang string yes The target language code (e.g., "de", "fr").
entries array yes Array of term pairs, each with "source" and "target" keys. E.g., [{"source": "hello", "target": "hallo"}].

google_translate_get_current_user

Verify the Google Cloud Translation API key and get connection information. Confirms the API key is valid and the service is reachable.

Operation
Read read
Full name
google-translate.google_translate_get_current_user
ParameterTypeRequiredDescription
No parameters.