Language Generate Command
The command
content- updates the labels.xlf
content for the specified Content Block. Already set labels in both the
labels.xlf file and in the config.yaml are considered. The labels.xlf
file has precedence over inline labels in the YAML definition. Optional keys
like descriptions or labels for existing fields will only be be generated if
they have been set manually. Custom translations, which don't belong to the
automatic language keys, will be kept and appended to the end.
Arguments
-
- Required
-
true (false if
--provided)extension - Type
-
string
The Content Block to generate the xlf for.
Options
-
- Shortcut
-
p
- Type
-
bool
Print labels.xlf to terminal instead of writing to file system.
-
- Shortcut
-
e
- Type
-
string
Write labels.xlf to all Content Blocks within the given extension.
-
- Type
-
bool
Keep the
dateattribute of an existing labels.xlf file instead of setting it to the current date. This avoids unnecessary changes in version control. If no labels.xlf file exists yet, the current date is used.
Write up-to-date labels.xlf file for Content Block example/example.
vendor/bin/typo3 content-blocks:language:generate example/example
Update all labels.xlf files within the extension "site_package".
vendor/bin/typo3 content-blocks:language:generate example/example --extension="site_package"
Update labels.xlf for Content Block example/example without changing the date.
vendor/bin/typo3 content-blocks:language:generate example/example --keep-date
Print up-to-date labels.xlf content for Content Block example/example.
vendor/bin/typo3 content-blocks:language:generate example/example --print
Example output:
<?xml version="1.0"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file datatype="plaintext" original="labels.xlf" source-language="en" date="2023-12-03T08:37:53+00:00" product-name="demo/demo">
<header/>
<body>
<trans-unit id="title">
<source>My demo title</source>
</trans-unit>
<trans-unit id="description">
<source>This is just a demo/demo</source>
</trans-unit>
<trans-unit id="header.label">
<source>Existing field override</source>
</trans-unit>
<trans-unit id="slug.label">
<source>My Slug</source>
</trans-unit>
<trans-unit id="slug.description">
<source>My Slug Description</source>
</trans-unit>
<trans-unit id="my_collection.label">
<source>my_collection</source>
</trans-unit>
<trans-unit id="my_collection.text.label">
<source>text</source>
</trans-unit>
<trans-unit id="my_collection.my_collection.label">
<source>my_collection</source>
</trans-unit>
<trans-unit id="my_collection.my_collection.text.label">
<source>text</source>
</trans-unit>
<trans-unit id="external_table.label">
<source>external_table</source>
</trans-unit>
<trans-unit id="external_table_2.label">
<source>external_table_2</source>
</trans-unit>
<trans-unit id="related_content.label">
<source>related_content</source>
</trans-unit>
<trans-unit id="my-custom-key">
<source>My translation</source>
</trans-unit>
</body>
</file>
</xliff>