PHPackages                             amdeu/typo3-locallang-formats - 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. amdeu/typo3-locallang-formats

ActiveTypo3-cms-extension

amdeu/typo3-locallang-formats
=============================

Alternative locallang formats

1.0.0(3d ago)02GPL-2.0-or-laterPHP

Since Mar 18Pushed 3d agoCompare

[ Source](https://github.com/amdeu/typo3-locallang-formats)[ Packagist](https://packagist.org/packages/amdeu/typo3-locallang-formats)[ RSS](/packages/amdeu-typo3-locallang-formats/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

locallang\_formats — Alternative translation file formats for TYPO3
===================================================================

[](#locallang_formats--alternative-translation-file-formats-for-typo3)

Author your TYPO3 translation labels in YAML, JSON, or PHP arrays instead of XLF.

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

[](#requirements)

- TYPO3 13.4 or later

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

[](#installation)

```
composer require amdeu/typo3-locallang-formats
```

No further configuration needed in consuming extensions. Once installed, TYPO3 will pick up `.yaml`, `.json`, and `.php` files in any extension's `Resources/Private/Language/` folder.

File format priority
--------------------

[](#file-format-priority)

The default priority order is `xlf → yaml → json → php`. XLF is always checked first so existing extensions are completely unaffected.

To change the priority globally (e.g. to prefer YAML over XLF in your project), change the `priority` setting in `TYPO3_CONF_VARS`:

```
$GLOBALS['TYPO3_CONF_VARS']['SYS']['lang']['format']['priority'] = 'yaml,xlf,json,php';
```

---

YAML
----

[](#yaml)

```
# locallang.yaml
header_comment: The default Header Comment.

login:
  title: Please log in
  submit: Submit
  errors:
    invalid: Invalid credentials
```

Translation file (`de.locallang.yaml`):

```
header_comment: Der Standard-Header-Kommentar.

login:
  title: Bitte einloggen
  submit: Absenden
  errors:
    invalid: Ungültige Anmeldedaten
```

---

JSON
----

[](#json)

```
{
    "header_comment": "The default Header Comment.",
    "login": {
        "title": "Please log in",
        "submit": "Submit",
        "errors": {
            "invalid": "Invalid credentials"
        }
    }
}
```

Translation file (`de.locallang.json`):

```
{
    "header_comment": "Der Standard-Header-Kommentar.",
    "login": {
        "title": "Bitte einloggen",
        "submit": "Absenden"
    }
}
```

---

PHP arrays
----------

[](#php-arrays)

```
