.. include:: /Includes.rst.txt .. _api_automatic_language_keys: ======================= Language Key Convention ======================= This feature refers to the :ref:`labels.xlf ` file. The translation keys follow a **convention** and are registered automatically. This feature is available for the following options (more may come). * :ref:`element title ` * :ref:`element description ` * :ref:`Field label ` * :ref:`Field description ` * :ref:`Palette label ` * :ref:`Palette description ` * :ref:`Tab ` * :ref:`FlexForm Sheets ` * :ref:`FlexForm Container ` It is also possible to translate the :yaml:`items` option of :ref:`Select `, :ref:`Radio ` and :ref:`Checkbox ` fields. The convention is best explained by examples. Have a look at the example beneath. .. note:: Labels defined in labels.xlf will always override :yaml:`label` defined in config.yaml. Workflow ======== The recommended workflow is defining the :yaml:`label` in the config.yaml first. When you are done, you run the :ref:`command ` to auto-generate the labels.xlf file. After that you can remove the labels from the yaml definition. You can also skip the first step and generate the xlf without defining labels first. This will add the :yaml:`identifier` as label and you can adjust it afterwards. Either way, it is recommended to maintain a labels.xlf file so you don't mix labels with configuration. Convention schema ================= The schema below displays most common conventions. Text in uppercase refers to values defined in :yaml:`identifier`. .. tip:: You don't have to remember all these rules. The command :ref:`content-blocks:language:generate ` creates the labels.xlf file with all available keys for you. .. code-block:: xml
This is the Content Type backend title This is the Content Type backend description This is the backend label for FIELD_IDENTIFIER This is the backend description for FIELD_IDENTIFIER This is the backend label for FIELD_IDENTIFIER in Collection COLLECTION_IDENTIFIER Label for Palette Description for Palette Label for Palette in Collection Label for Palette in nested Collection Label for Tab Label for Tab in Collection Label for Tab in nested Collection