Localization

Localization is a core part of Lucent CMS. It is a european product and most of our own customers need more than one language most of the times.

When you create a channel you have to choose your main locale. Be 100% sure of your choice because you will not be able to change it later.

If you don't need more that one language you can go on with your life. You can add up 9 locales. In case you need more you will have to contact us to discuss a custom plan.

You can choose which fields are localized and which are not. For a product, a logical choice would be to localize the title but not the price. When you edit a document, you can choose which languages apart from the main you want to be visible.

Advanced cases

Relationships

Relationship fields can also be localized but take a look of how they work:

Let say that we have blog post and a category which are linked together and are both translatable. If the relationship field is not localized and you fetch the resource, the category will also get served in the locale of your request. So when you say that a relationship is localized, it doesn't define the relationship's document content. The only reason to define a relationship as localized, is if you want to have different relastionship per locale.

Subdocuments

Subdocuments are like documents inside documents. So they behave exactly as an ordinary document. All locales will contain the same subdocuments and you will be able to translate them per field, if you choose so.

Combos

Combos are your custom-made fields, so they behave as ordinary fields. If you choose a combo field to be localized, all the fields indise the combo will be localized or not depending on your choice. You can't choose to localize one field inside a combo and not another one. It's all or nothing. And that's a feature by the way.

Deleting a locale

Deleting a locale will not affect your documents immediately. If you will add it again, everything will be in place. But if you don't the system will ignore the deleted locale, so new document won't be translated and old document translations will not be accesible and will be overwritten over time.

Accessing Translations

The API behaves in the following way:

If you request a localized response. All localized field will return their localized version.

{
    "id": "1"
    "content": {
        "title": "A title"
    }
}

If you request a response without a specific locale, the document will return all translations.

{
    "id": "1"
    "content": {
        "title": {
            "en-US": "A title",
            "fr-FR": "Un titre"
        }
    }
}