> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TranslationServiceImpl

> Calling public service methods through the REST API: translationServiceImpl

<ResponseField name="beanId" type="string">
  The Spring bean identifier containing the service being called.

  translationServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Bean scope. Use PROTOTYPE for service calls.
</ResponseField>

<ResponseField name="functionName" type="string">
  The public service method name shown in the signature below.
</ResponseField>

<ResponseField name="args" type="object[]">
  The method argument array. Each argument is passed as an object with index 0, 1, and so on; the value must match the Java parameter type.
</ResponseField>

## Headers

```http theme={null}
POST /api/v1/bean/request
Content-Type: application/json
Lang-Context: en
Site-Context: my-site
Authorization: Bearer <token>
```

Send `Lang-Context` and `Site-Context` with every request. For protected methods, send the JWT in the `Authorization` header as `Bearer <token>`.

**Access:** GUEST. **Bearer Token:** not required.

* GUEST — unauthenticated users; only whitelist services are available.
* USER — authentication is required; methods with USER checks are available.
* ADMIN — full access to public methods of all services.
* If a method checks a role internally, GUEST may receive null.

## Methods

<ResponseField name="init" type="void">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### init

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "init",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getRepository" type="TranslationsRepository">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getRepository

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getRepository",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getLanguageRepository" type="LanguageRepository">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getLanguageRepository

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getLanguageRepository",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getPaginationFilter" type="Deque<Map<String, Object>>">
  | Argument      | Type     | Description                 |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Passed through `args[0].0`. |

  ### getPaginationFilter

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getPaginationFilter",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslations" type="LinkedHashSet<LocalizedText>">
  | Argument      | Type     | Description                 |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Passed through `args[0].0`. |

  ### searchTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslations",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslationsPaged" type="Page<LocalizedText>">
  | Argument      | Type     | Description                 |
  | ------------- | -------- | --------------------------- |
  | `requestJson` | `String` | Passed through `args[0].0`. |

  ### searchTranslationsPaged

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslationsPaged",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslations" type="List<LocalizedText>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `query`  | `String` | Passed through `args[0].0`. |
  | `offset` | `String` | Passed through `args[1].1`. |
  | `limit`  | `String` | Passed through `args[2].2`. |

  ### searchTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslations",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslationsById" type="List<LocalizedText>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `regex`  | `String` | Passed through `args[0].0`. |

  ### searchTranslationsById

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslationsById",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="findTranslations" type="List<LocalizedText>">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### findTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "findTranslations",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="findTranslationsByLangCode" type="List<LocalizedText>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `lang`   | `String` | Passed through `args[0].0`. |

  ### findTranslationsByLangCode

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "findTranslationsByLangCode",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationsByLangCode" type="Map<String, String>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `lang`   | `String` | Passed through `args[0].0`. |

  ### getTranslationsByLangCode

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationsByLangCode",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getLangFromContext" type="String">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getLangFromContext

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getLangFromContext",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getTranslatedTimeDuration" type="Map<String, String>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `date`   | `String` | Passed through `args[0].0`. |

  ### getTranslatedTimeDuration

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslatedTimeDuration",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationById" type="LocalizedText">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `id`     | `String` | Passed through `args[0].0`. |

  ### getTranslationById

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationById",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslation" type="Map<String,String>">
  | Argument         | Type     | Description                 |
  | ---------------- | -------- | --------------------------- |
  | `id`             | `String` | Passed through `args[0].0`. |
  | `repositoryName` | `String` | Passed through `args[1].1`. |

  ### getTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslation",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslation" type="Map<String, String>">
  | Argument         | Type     | Description                 |
  | ---------------- | -------- | --------------------------- |
  | `id`             | `String` | Passed through `args[0].0`. |
  | `lang`           | `String` | Passed through `args[1].1`. |
  | `repositoryName` | `String` | Passed through `args[2].2`. |

  ### getTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslation",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationValue" type="String">
  | Argument         | Type     | Description                 |
  | ---------------- | -------- | --------------------------- |
  | `id`             | `String` | Passed through `args[0].0`. |
  | `repositoryName` | `String` | Passed through `args[1].1`. |

  ### getTranslationValue

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationValue",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationValue" type="String">
  | Argument         | Type     | Description                 |
  | ---------------- | -------- | --------------------------- |
  | `id`             | `String` | Passed through `args[0].0`. |
  | `lang`           | `String` | Passed through `args[1].1`. |
  | `repositoryName` | `String` | Passed through `args[2].2`. |

  ### getTranslationValue

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationValue",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchLanguages" type="List<Language>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `query`  | `String` | Passed through `args[0].0`. |
  | `offset` | `String` | Passed through `args[1].1`. |
  | `limit`  | `String` | Passed through `args[2].2`. |

  ### searchLanguages

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchLanguages",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="findLanguages" type="List<Language>">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### findLanguages

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "findLanguages",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="createTranslation" type="Optional<LocalizedText>">
  | Argument           | Type                            | Description                 |
  | ------------------ | ------------------------------- | --------------------------- |
  | `translationAsMap` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### createTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "createTranslation",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="createLanguage" type="Optional<Language>">
  | Argument    | Type                            | Description                 |
  | ----------- | ------------------------------- | --------------------------- |
  | `langAsMap` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### createLanguage

  Example JSON request object:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "isoCode":  null,
      "translations":  null,
      "fallIntoObjects":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "createLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveTranslation" type="Optional<LocalizedText>">
  | Argument           | Type                            | Description                 |
  | ------------------ | ------------------------------- | --------------------------- |
  | `translationAsMap` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### saveTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveTranslation",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveArticle" type="Optional<LocalizedText>">
  | Argument    | Type     | Description                 |
  | ----------- | -------- | --------------------------- |
  | `text`      | `String` | Passed through `args[0].0`. |
  | `articleId` | `String` | Passed through `args[1].1`. |

  ### saveArticle

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveArticle",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveLanguage" type="Optional<Language>">
  | Argument    | Type                            | Description                 |
  | ----------- | ------------------------------- | --------------------------- |
  | `langAsMap` | `LinkedHashMap<String, Object>` | Passed through `args[0].0`. |

  ### saveLanguage

  Example JSON request object:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "isoCode":  null,
      "translations":  null,
      "fallIntoObjects":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeTranslationAndClean" type="void">
  | Argument        | Type     | Description                 |
  | --------------- | -------- | --------------------------- |
  | `translationId` | `String` | Passed through `args[0].0`. |

  ### removeTranslationAndClean

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeTranslationAndClean",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeTranslationsByIds" type="void">
  | Argument         | Type                | Description                 |
  | ---------------- | ------------------- | --------------------------- |
  | `translationIds` | `ArrayList<String>` | Passed through `args[0].0`. |

  ### removeTranslationsByIds

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeTranslationsByIds",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeTranslationsByLanguage" type="void">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `langId` | `String` | Passed through `args[0].0`. |

  ### removeTranslationsByLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeTranslationsByLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeLanguageAndClean" type="void">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `langId` | `String` | Passed through `args[0].0`. |

  ### removeLanguageAndClean

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeLanguageAndClean",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeLanguagesByIds" type="void">
  | Argument      | Type                | Description                 |
  | ------------- | ------------------- | --------------------------- |
  | `languageIds` | `ArrayList<String>` | Passed through `args[0].0`. |

  ### removeLanguagesByIds

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeLanguagesByIds",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslations" type="HashSet<LocalizedText>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `langEn` | `String` | Passed through `args[0].0`. |
  | `langDe` | `String` | Passed through `args[1].1`. |

  ### getTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslations",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getAlphabetForActiveLanguage" type="List<Map<String, Object>>">
  | Argument | Type     | Description                 |
  | -------- | -------- | --------------------------- |
  | `isUpp`  | `String` | Passed through `args[0].0`. |

  ### getAlphabetForActiveLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getAlphabetForActiveLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getAlphabetForLanguage" type="List<Map<String, Object>>">
  | Argument   | Type     | Description                 |
  | ---------- | -------- | --------------------------- |
  | `isUpp`    | `String` | Passed through `args[0].0`. |
  | `language` | `String` | Passed through `args[1].1`. |

  ### getAlphabetForLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getAlphabetForLanguage",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getDefaultLanguage" type="String">
  | Argument | Type | Description                            |
  | -------- | ---- | -------------------------------------- |
  | —        | —    | This method does not accept arguments. |

  ### getDefaultLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getDefaultLanguage",
    "args": []
  }
  ```
</ResponseField>
