APIs that need to handle requests or responses with descriptive fields which could be expressed in more than one language must use a specific object called LocalizedString instead of a simple Java String.
In an API response, if there are several languages configured in the company.properties file, the resulting JSON will have a new representation for the multi-language field. The LocalizedString will be converted into a collection of objects, each containing two fields, one to explicit the language (i.e., “lang” = “IT”, codes provided by the IANA Language Subtag Registry [12]) and the other will contain the information properly translated into the language expressed by the first field (i.e., “value” = “MyTranslatedValue”).
If no dictionary is configured in the system, the LocalizedString will handle a value in the same exact way, with the default language which is the English language, so the resulting collection will only contain one object with the information and its language.
If one desires to exchange information in a single language only, it can be done by allowing the client to specify a filter parameter which contains the desired language information. Moreover, if the authenticated user, which is the one calling the API, has only one language set in its profile, then the LocalizedString representation can be automatically filtered for that language.