Every kind of message
Message templates of API Maker, constant errors, and the errors your custom APIs list in their errorList.
API Maker
The framework for AI era
Your code
Every error message in the language of the caller.
Create a language pack in API Maker and translate the messages you want: validation messages, system errors and the errors of your own custom APIs. A client sends x-am-internationalization with the name of the pack and gets its errors in that language.
Step through it, slow it down, or open the full canvas.
Errors in the language of the caller. Send x-am-internationalization with the name of a language pack. The same request gets its error in English, Hindi, Spanish, Japanese or Chinese.
Send x-am-internationalization with the name of a language pack. The same request gets its error in English, Hindi, Spanish, Japanese or Chinese.
Each system error has a code and a template. A pack gives your own template for the codes you want, in any script: Unicode just works.
A code the pack does not have uses the Default English template, so a half done pack is already safe to use.
The COMMON map of a pack replaces words in the message data: cust_nm becomes customer name. A pack can also reword the English messages for a region.
Errors your custom APIs return are listed in each pack to translate. Save a pack and the next request uses it: no restart.
Message templates of API Maker, constant errors, and the errors your custom APIs list in their errorList.
A new pack comes with every message in English. Translate the ones you need; the others keep working.
The COMMON map of a pack replaces words inside messages, so cust_nm can read as customer name, in any language.
Packs are plain text mappings, so Hindi, Japanese, Arabic or Chinese work like English.
A mobile app sends the language of the phone in x-am-internationalization. Validation errors and the messages of your own APIs come back in that language, and the app shows them as they are.
let mappings = { COMMON: { cust_nm: 'nombre del cliente' }, AM_00001: { template: `Proporcione un campo '{field}' válido de tipo '{type}'.` }, CUSTOM_API_ERRORS: { 'No paid orders for this customer.': 'No hay pedidos pagados para este cliente.', },};module.exports = mappings;AM_00001 is the "required" message of the schema APIs. A new pack lists every key with its English text.
POST /api/schema/admin/crm/main/customers/save-single-or-multiplex-am-authorization: <API user token>x-am-internationalization: es{ "email": "[email protected]" }The default English messages are used.
List them in the errorList of your custom API, throw them from your code, and give them a translation in the pack.
Documentation