How to translate texts in API Designer?

I have a custom API project (OI 8.1.2) and want to return translated values e.g. error messages. I search for something like translate("#LDS#xyz") from Web Designer but I can't find anything.

The compiler states that there are hundreds of keys and values:
Starting multi-language preloading
13 cultures found that require translations
xxxx keys found
yyyy key translations found

How can I use one of those in the composition api or add one?

  • Maybe a bit late but still useful: The" xxxx keys found yyyy key translations found" are the in-memory translations. Those are exposed via the api method "imx/multilanguage/translations/all" which you can consume on client side (the HTML5 applications for instance).

    But now for your question: You can make use of the translation within the API by using e.g.:

    string translatedItem = new MultiLanguageStringData() { Key = <EntryKey>, UidColumn = "<UID_DialogColumn>" }.Translate(session);

    This translates an item based on the culture of the session. The session's culture is primarily the one that comes with the accept-language header from the client or alternatively the internal culture setting of the person the session belongs to.