csspin_ce.localization
The csspin_ce.localization plugin provides a wrapper for the localization
(l10n) tool.
How to setup the csspin_ce.localization plugin?
For using the csspin_ce.localization plugin, a project’s spinfile.yaml must
at least contain the following configuration.
spinfile.yaml for csspin_ce.localizationplugin_packages:
- csspin_ce
plugins:
- csspin_ce.localization
contact_elements:
umbrella: <The umbrella to use>
python:
version: '3.11.9'
index_url: <package server index url to retrieve CE wheels from>
java:
version: '17'
node:
version: '18.17.1'
The environment variable DEEPL_AUTH_KEY is required so that plugin can translate new
strings with DeepL.
Further configuration in spinfile.yaml is optional for this plugin.
In most cases you can rely on defaults. However, it’s worth mentioning,
that you can configure the languages you want the component
to be localized into with target_languages parameter.
The provisioning of the required tools and the plugins dependencies can be done
via the well-known spin provision-command.
How to automate localization with csspin_ce.localization?
spin localize-ce command can be used for this purpose.
Internally, the command exports strings from the database of your CONTACT Elements instance
into XLIFF files. These files are saved at the path specified by localization.xliff_dir,
which defaults to /tmp/l10n_<project_name>. It then synchronizes strings
that have been modified (added, deleted, or changed) within the instance database
and translates those lacking translations.
The --check-only flag makes the command only check whether the project
is fully localized. It does not apply any changes and does not perform DeepL API requests.
csspin_ce.localization schema reference
- localization: 'object'
The localization plugin for csspin provides a wrapper around the localization (l10n) CLI tool.
- localization.target: 'path'
The root directory of the Python project.
- localization.target_langs: 'list'
List of target languages for localization.
- localization.xliff_dir: 'path'
The export directory of XLIFF files.
- localization.schema: 'object'
- localization.requires: 'object'
- localization.requires.python: 'list'
- localization.requires.spin: 'list'
- localization._requires: 'list'