The Lucca API does not localize responses based on the client’s locale. Instead, it provides exhaustive data, allowing clients to localize content according to their own users’ preferences.

Some resource properties in the Lucca API support translations. When they do, the response will include a reserved t9n object containing localized versions of those properties. This object maps translatable property names to a dictionary of translations, keyed by IETF BCP 47 language tags:

{
    "name": "INVARIANT_NAME",
    "t9n": {
        "name": {
            "fr": "FRENCH-INT_NAME",
            "fr-FR": "FRENCH-FRANCE_NAME",
            "fr-CH": "FRENCH-SWITZERLAND_NAME",
            "en": "ENGLISH-INT_NAME",
            "en-US": "ENGLISH-US_NAME"
        }
    }
}

In this example, the name property holds the invariant (default) value. The t9n object provides localized alternatives, allowing the client to choose the most appropriate translation based on user preferences.

Only the invariant value is guaranteed to be present. The t9n translations are optional and may be incomplete.

Client guidance

When displaying localized values, clients should attempt to match the user’s language preferences as closely as possible. A common fallback strategy would be:

1

Look for a region-specific tag

For example: "fr-CH".

2

Fall back to alternative language tag(s)

For example: "fr-FR", then "fr".

3

Finally, use the invariant value

This ensures a graceful degradation in case specific translations are not available.