PHPackages                             nowo-tech/translation-yaml-tools-bundle - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. nowo-tech/translation-yaml-tools-bundle

ActiveSymfony-bundle[Localization &amp; i18n](/categories/localization)

nowo-tech/translation-yaml-tools-bundle
=======================================

Symfony console tools for YAML translations: nested tree conversion, key sorting, and machine translation for missing keys (Google, DeepL, LibreTranslate; pluggable).

v1.0.0(3w ago)0862↑750%[1 PRs](https://github.com/nowo-tech/TranslationYamlToolsBundle/pulls)MITPHPPHP &gt;=8.2 &lt;8.6

Since Apr 9Pushed 1mo agoCompare

[ Source](https://github.com/nowo-tech/TranslationYamlToolsBundle)[ Packagist](https://packagist.org/packages/nowo-tech/translation-yaml-tools-bundle)[ Docs](https://github.com/nowo-tech/TranslationYamlToolsBundle)[ RSS](/packages/nowo-tech-translation-yaml-tools-bundle/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (44)Versions (18)Used By (0)

Translation YAML Tools Bundle
=============================

[](#translation-yaml-tools-bundle)

[![CI](https://github.com/nowo-tech/TranslationYamlToolsBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/TranslationYamlToolsBundle/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/4a10ba8f5a405b8c7de291080a28b2f5d3f27151aebdb468e08cab4ca879af85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f7472616e736c6174696f6e2d79616d6c2d746f6f6c732d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/translation-yaml-tools-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/406028fb09f1b97bb8a79d53b2e5b04720f58c670ea9c120f1f996a27c5caf37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f7472616e736c6174696f6e2d79616d6c2d746f6f6c732d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/translation-yaml-tools-bundle)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/3f99b197569aa2dcfbefff17ecc68d74098e7f929d8b52dc40f3a898f740eae1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f6c6f676f3d706870)](https://php.net)[![Symfony](https://camo.githubusercontent.com/1c8d9cc0213fd311e1cbf64a276402a99bb96c6d197f4e8ed0a038dd7e19bd9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d372e30253242253230253743253230382e30253230253743253230382e312532422d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com)

> ⭐ **Found this useful?** Install from [Packagist](https://packagist.org/packages/nowo-tech/translation-yaml-tools-bundle) and consider starring [the repository](https://github.com/nowo-tech/TranslationYamlToolsBundle).

Symfony developer tools for **YAML translation files**: discover configured translation directories, convert flat dot-keys to a **nested tree** (with structural validation), **flatten** nested maps back to dot-keys at the file root, **sort** keys alphabetically, and **fill missing** keys in a target locale using **Google Cloud Translation**, **DeepL**, or **LibreTranslate** (pluggable `MachineTranslatorInterface`). The default source locale follows Symfony’s translator / kernel default locale (see **`docs/CONFIGURATION.md`**) unless you set **`nowo_translation_yaml_tools.default_locale`**.

Features
--------

[](#features)

- Resolves translation paths from **`translator.default_path`** and from **`config/packages/**/translation.yaml`** (`framework.translator.default_path` and `paths`).
- **Interactive** console flow (arrow keys) to pick **domain**; for **`tree`**, **`flatten`**, and **`sort`**, **`--locale` is optional** (omit to process every locale for that domain). Non-interactive: **`--domain`** alone runs all locales; **`--locale`** limits to one file. Other commands (e.g. **`fill-missing`**) keep their own locale / target options.
- **`nowo:translation-yaml:tree`** — validates that dot-keys can be represented as a nested tree; on failure prints the conflicting prefix. Optional **`--fix-leaf-prefix`** renames blocking leaves (suffix configurable via **`yaml_tree_leaf_prefix_suffix`**, default **`index`**).
- **`nowo:translation-yaml:flatten`** — writes a one-level map with dot-separated keys (inverse of the tree layout).
- **`nowo:translation-yaml:sort`** — recursive alphabetical sort of associative keys.
- **`nowo:translation-yaml:fill-missing`** — merges missing keys into a target locale using the configured machine translator (Google, DeepL, or LibreTranslate); optional `--tree` output with the same validation as the tree command.
- **`nowo:translation-yaml:audit`** — read-only report: tree-safe YAML, alphabetical key order, missing keys vs source locale; compact **OK** line per domain when everything passes.
- Configurable **YAML indent** (`yaml_tree_indent`) and **leaf-prefix suffix** (`yaml_tree_leaf_prefix_suffix` for `tree --fix-leaf-prefix`) for dumps / renames.

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

[](#requirements)

- PHP `>=8.2
