API response language
A response can contain user-facing text, such as a validation message. Send anAccept-Language header to choose its language.
Content-Language header telling you which locale was used.
en and fr. A request with no Accept-Language header, or one naming a locale Nmbr does not support, is answered in English.
The header changes two things: the messages Nmbr generates, and which translation is returned for translatable attributes.
Response
Translatable attributes
Some values are customer-generated, such as a pay rate’s title. These values can carry a translation for each supported locale, and Nmbr returns the one matching the request.title, label, name, and description are translatable where an endpoint offers them. Check the API reference for the endpoint you are working with.
Where an attribute is translatable, it appears three times in a response. Taking title on a pay rate as the example:
title is the default, used when no translation matches the requested locale. title_translations holds a translation per locale. title_translated is resolved for you: Nmbr returns the translation matching the request locale, and falls back to title when there is none.
Request
Accept-Language: fr
Accept-Language: en, or with no header, returns "title_translated": "Weekend rate". There is no en translation, so title is used.
title and title_translations are independent, so set a translation only for the locales you care about. A locale present in title_translations does not have to match title, and you do not need an entry for the language title happens to be written in. Nmbr never derives one language from another: title_translated only ever returns a value you supplied, or title.
Writing translations
Send the_translations object with a key for each locale you want to set. You do not have to supply every locale. Any locale you leave out falls back to the base attribute when read.
Nmbr rejects a _translations value that is not an object, contains a key that is not a supported locale, or has an empty or non-string value for any locale.
Sending _translations replaces the whole set. To remove a locale, send the object again without that locale. To clear every translation, send null.
Some translatable attributes are read-only Nmbr reference data rather than text you own. They follow the same three-field shape, and Nmbr supplies the translations.
Response from a bank account lookup, with Accept-Language: fr
Payee communications
A payee receives communications from Nmbr, such as pay stub emails and year-end forms, and each needs to be in their preferred language. That language comes from a stored setting,preferred_locale.
Locale inheritance
Setpreferred_locale at the level you want it to apply. Any level you leave unset inherits from the one above it. With nothing set at any level, communications default to English.
Setting it on a business entity does not change the language for payees working there. Payees inherit from the company, because one person can hold work assignments at more than one business entity.
Sending
Accept-Language: fr does not change what an employee receives in their inbox. Setting preferred_locale to fr does not change the language of your API responses.
