PHPackages                             labor-digital/typo3-translation-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. labor-digital/typo3-translation-utils

ActiveTypo3-cms-extension[Utility &amp; Helpers](/categories/utility)

labor-digital/typo3-translation-utils
=====================================

A set of TYPO3 cli tasks for working with translation labels

10.0.5(4y ago)0491Apache-2.0PHP

Since Aug 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/labor-digital/typo3-translation-utils)[ Packagist](https://packagist.org/packages/labor-digital/typo3-translation-utils)[ RSS](/packages/labor-digital-typo3-translation-utils/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (11)Used By (0)

TYPO3 - Translation Utils
=========================

[](#typo3---translation-utils)

A simple development helper package which provides some command line utilities to work with translation files.

**A word of caution:** This is a development helper and should not be installed on a production machine!

Requirements
------------

[](#requirements)

- TYPO3 v10
- [TYPO3 - Better API](https://github.com/labor-digital/typo3-better-api)
- Installation using Composer

Installation
------------

[](#installation)

Install this package using composer:

```
composer require labor-digital/typo3-translation-utils --dev

```

After that, you can activate the extension in the Extensions-Manager of your TYPO3 installation

Documentation
-------------

[](#documentation)

#### t3tu:export &lt;EXT\_KEY&gt;

[](#t3tuexport-ext_key)

Exports the translation labels of an extension into a csv file. A csv file will be created for every base translation file in your extension. Meaning locallang.xlf will be exported into locallang.csv, while locallang\_be.xlf will be exported into locallang\_be.csv.

The script will load all translations in your directory, that are named de.locallang.xlf, es.locallang.xlf,... and put the labels into their own column of the file.

With this you can easily provide your Translators an overview of all translations and their matching key.

##### Option: --format | -f

[](#option---format---f)

Allows you to change the output format of the translations. By default a .csv file is exported. With this option you can also set it to .xls, .xlsx or .ods, depending on your needs

#### t3tu:import &lt;EXT\_KEY&gt;

[](#t3tuimport-ext_key)

Imports the csv files of a translation into xlf translation files. This is basically the reverse operation to "export". After you changed the content in your csv files in your translation directory. This command will read all the csv files and update/create the required translation xlf files.

**NOTE**If the script finds .xls, .xlsx or .ods files in your language directory, it will parse them in the same way it does .csv files. This is helpful if you have issues with UTF-8 encoded chars in your excel file

#### t3tu:sync &lt;EXT\_KEY&gt;

[](#t3tusync-ext_key)

Synchronizes all translation files (e.g. de.locallang.xlf,...) with your origin file (e.g. locallang.xlf) and vice versa.

The sync uses the origin file, as "source of truth", meaning all translation keys you add or remove there will be added/removed to the matching translation files. All newly created entries in the translation files are prefixed with COPY FROM - $SOURCELANG: to make them easy to spot.

If you rename a translation key in the origin file, the keys in the translation files will be updated automatically to match. (ONLY if the "source" tag matches both the origin file and the translation file, otherwise the key in the translation file will be recreated!).

The sync will automatically update the "source" tag in your translation files if it was changed in the origin file.

The sync will also make sure that all source files, have the same language variants available to them. This means in practice, if you start with:

- locallang.xlf
- de.locallang.xlf
- locallang\_be.xlf
- es.locallang\_be.xlf

After the sync you will get something like this:

- locallang.xlf
- de.locallang.xlf
- es.locallang.xlf
- locallang\_be.xlf
- de.locallang\_be.xlf
- es.locallang\_be.xlf

You can also introduce a new language variant by adding an empty file for your language. The file gets automatically prepared with a dummy content and added to all existing origin files.

### Configuration

[](#configuration)

You can configure the extension using the "ext config" framework provided by the [TYPO3 - Better API](https://github.com/labor-digital/typo3-better-api)extension. To create a config, add a new class under `$ext_key/Configuration/ExtConfig/TranslationUtils.php` which looks like this:

```
