Releases: CreativeNative/translation-bundle
v2.0.1
Bug Fix
- Fix unresolved
%kernel.default_locale%parameter reference —processConfiguration()does not resolve Symfony%param%references, so thedefault_localevalidation againstenabled_localesalways failed when left at its default. Now resolved viaParameterBag::resolveValue()before validation, and the resolved value is stored into container parameters. When the default locale uses environment variables (%env(...)%), compile-time validation is skipped since the actual value is only known at runtime.
v2.0.0 Real-World Ready
v2.0.0 Real-World Ready
Clean breaking changes, extracted cache service, type-safe translation defaults, compile-time validation, and complete migration documentation.
Breaking Changes
getTuuid()now returnsTuuid(non-nullable) — remove any null checks- Bundle reads locales from Symfony's
framework.enabled_locales— removetmi_translation.locales - Config flattened:
logging.enabled→ root-levelenable_logging
See UPGRADING.md for migration guide with before/after examples.
New Features
- Translation Cache Service —
TranslationCacheInterfacewithInMemoryTranslationCache(default) andPsr6TranslationCacheimplementations - Type-Safe EmptyOnTranslate Defaults — Non-nullable scalars get zero-values (
string→"",int→0,float→0.0,bool→false) instead of throwing exceptions - Fallback Control —
copy_sourceconfig option (default:false) with per-entity#[Translatable(copySource: true)]override - Compile-Time Validation —
AttributeValidationPasscatches attribute conflicts at container build;TranslatableEntityValidationWarmervalidates unique constraints atcache:warmup
Quality
- 409 tests, 2674 assertions
- 100% code coverage (1054/1054 lines)
- PHPStan level max (0 errors)
- Zero
@phpstan-ignoreannotations
Documentation
- UPGRADING.md migration guide with before/after code examples
- llms.md updated with all v2.0 features
- AI skills (entity-translation-setup, translation-debugger, custom-handler-creator) updated for v2.0
v1.8.1 Quality Hardening
What's New
This release hardens the codebase to the highest quality bar — PHPStan level max with zero errors, 100% line coverage, and strict PHPUnit mode — all without changing any runtime behavior.
Static Analysis: PHPStan Level Max
- Zero errors at level max — reduced from 917 errors to 0 across src/ and tests/
- Zero
@phpstan-ignoreannotations — every error fixed at the root cause using assertion-based narrowing - phpstan-doctrine formalized in require-dev for Doctrine metadata type awareness
- Config locked:
level: maxin phpstan.neon, singlecomposer stancommand
Type Safety
- Handler chain verified: All 10 handlers have explicit type narrowing at every
getDataToBeTranslated(),getProperty(), andgetTranslatedParent()call site - ORM 3 typed API migration: All handler association access uses
instanceof InverseSideMapping/OwningSideMappingwith typed property syntax ($assoc->mappedBy) instead of array syntax - Interface coupling: Handlers depend only on
EntityTranslatorInterface, removed concrete class downcasts - DI extension: Typed array shape for
processConfiguration()return, simplified logging config access
Test Quality
- 293 tests, 2101 assertions — up from 275 tests, 2012 assertions
- Strict mode:
failOnWarning,failOnNotice,failOnRiskyall enabled — zero violations - 100% line coverage: 813/813 lines, 153/153 methods, 29/29 classes
- CI enforcement: Coverage threshold raised from 95% to 100%
PHPDoc Improvements
TranslatableInterface::getTranslations()return type narrowed toarray<string, array<string, mixed>>TranslatableTrait::$translationsproperty type narrowed to match- Typed accessor methods on test base classes for null-safe property access
EntityTranslatorInterfaceenhanced with full@param/@returnPHPDoc
Internal
- 37 atomic commits across 13 plans in 5 phases
- PHPUnit mock notices resolved with
#[AllowMockObjectsWithoutExpectations]attribute ReflectionMethod::invoke()replaces variable method calls for strict mode compliance- Stale
@varannotations, dead imports, and unused code removed
Full Changelog: v1.8.0...v1.8.1
v1.8.0 Validation & Safety
What's New
This release adds attribute validation, embedded object improvements, and debug logging for safer, more predictable translation behavior.
Validation & Safety
- Attribute conflict detection:
SharedAmongstTranslations+EmptyOnTranslateon the same property now throws aLogicExceptionwith a clear, actionable error message including code examples - Readonly validation:
EmptyOnTranslateon a readonly property throws aLogicExceptionat translation time with solution suggestions - Exception hierarchy: New
ValidationException,AttributeConflictException,ReadonlyPropertyException, andClassLevelAttributeConflictException— all with detailed heredoc messages
Embedded Object Improvements
- Per-property resolution:
EmbeddedHandlerrewritten with a three-level cascade (property-level → class-level → default) for predictable behavior - Class-level attributes:
#[SharedAmongstTranslations]and#[EmptyOnTranslate]can now be placed on Embeddable classes to set defaults for all properties - Mixed attribute support: Embedded objects with both Shared and Empty inner properties now resolve each property independently
Developer Experience
- PSR-3 debug logging:
EntityTranslatoraccepts an optionalLoggerInterface— zero overhead when no logger is configured - Handler tracing: Debug-level logs show which handler processes each property and which attributes are detected
- Bundle configuration: New
tmi_translation.logging.enabledoption (default:true)
Internal
- 14 atomic commits across 5 plans
- 275 test methods, PHPStan level 1 clean
EntityTranslatorembedded processing simplified from 22 lines to 8 lines
Full Changelog: v1.7.0...v1.8.0
v1.7.1 - Documentation restructuring
Changes
- Move AI skills from
.claude/skills/to.agents/skills/for tool-agnostic structure - Remove
.planning/from repository (now gitignored) - Update skill paths in
llms.txt - Add "AI-Assisted Development" section to README with usage instructions
- Add "AI-ready" feature highlight to Key Features
AI Skills
The bundle now includes portable AI skills in .agents/skills/:
| Skill | Purpose |
|---|---|
| entity-translation-setup | Guide for making entities translatable |
| translation-debugger | Diagnose translation configuration issues |
| custom-handler-creator | Create custom handlers for specialized fields |
Works with Claude Code and other AI coding assistants.
Full Changelog: v1.7.0...v1.7.1
v1.7.0 - AI-Ready Documentation
This release makes the TMI Translation Bundle fully accessible to AI assistants and developers through comprehensive documentation, interactive skills, and machine-discoverable resources.
Highlights
AI Discovery Support
- llms.txt - Machine-readable index following the https://llmstxt.org/ standard for AI
crawlers - llms.md - Comprehensive developer and AI guide with glossary, handler chain decision
tree, and troubleshooting reference
Claude Code Skills
Three interactive skills to accelerate development:
- Entity Translation Setup - Guided workflow to make any Doctrine entity translatable
with TranslatableInterface, TranslatableTrait, and proper attribute configuration - Translation Debugger - Systematic diagnostic tool to identify and fix translation
configuration issues - Custom Handler Creator - Step-by-step guide for building custom translation handlers
for specialized field types
Foundation Documentation
- Glossary - Canonical terminology definitions (Tuuid, Handler Chain, Locale, etc.)
- Handler Chain Decision Tree - Visual ASCII diagram showing field routing logic and
handler priorities - Troubleshooting Guide - Common issues with symptoms, causes, and solutions
- Minimal Working Example - Complete copy-paste implementation reference
What's Changed
This is a documentation-only release with no changes to PHP source code. All features
from v1.6.0 remain unchanged.
Full Changelog: v1.6.0...v1.7.0
v1.6.0 — Improved Nullable Detection and Doctrine-Bundle 3 Support
What's Changed
- Fixed: Nullable detection now uses PHP type hints instead of Doctrine column attributes
- Added: Support for nullable embeddables and other Doctrine mapping types
- Improved: AttributeHelper code structure to eliminate duplicate code
- Updated: Doctrine bundle dependency to support ^3.0
Why It Matters
-
Robust Nullable Handling: The bundle now correctly detects nullable properties for all Doctrine mapping types (Embeddables, Relations, etc.), not just Column fields. This resolves issues where
@EmptyOnTranslatevalidation failed incorrectly for nullable embeddables. -
Future-Proof Architecture: The refactored AttributeHelper provides a cleaner, more maintainable codebase while maintaining full backward compatibility.
-
Doctrine 3 Ready: Explicit support for doctrine/doctrine-bundle ^3.0 ensures compatibility with the latest Doctrine ecosystem.
Breaking Changes
None - This release maintains full backward compatibility while improving internal logic.
Technical Details
AttributeHelper::isNullable()now usesReflectionProperty::getType()->allowsNull()instead of checking Doctrine's@Column(nullable)- Centralized attribute checking logic eliminates code duplication
- Better support for complex entity structures with inheritance and embeddables
Full Changelog: v1.5.6...v1.6.0
v1.5.6 — Update dependencies
What's Changed
- Updated: Symfony dependency constraints to allow both ^7.3 and ^8.0.
- Removed: PHP_CodeSniffer-related packages (
phpcompatibility/php-compatibility,slevomat/coding-standard) and installer plugin (dealerdirect/phpcodesniffer-composer-installer).
Why It Matters
- Symfony 8 Support: Ensures the bundle can be installed on projects using Symfony 8.
- Cleaner Dev Setup: Removes unnecessary PHP_CodeSniffer dependencies, reducing complexity.
Full Changelog: v1.5.5...v1.5.6
v1.5.5 — Github workflow: create cache folder and remove composer hooks
What's Changed
- Updated: GitHub workflow creates
var/cachefolder beforecomposer install. - Removed: Composer
post-install-cmdandpost-update-cmdhooks. - Improved: Ensures PHP-CS-Fixer can run without cache errors and no config override is needed.
Why It Matters
- CI Stability: Prevents PHP-CS-Fixer errors in GitHub Actions due to missing cache folder.
- Cleaner Composer Setup: Checks are now run manually in workflow instead of composer hooks.
- Predictable Build: Workflow order ensures directories exist before dependencies are installed.
Full Changelog: v1.5.4...v1.5.5
v1.5.4
What's Changed
- Updated: GitHub Actions workflow to create
var/cacheand ensure it's writable for PHP-CS-Fixer.
Why It Matters
- CI Stability: Prevents fatal errors during coding standards checks.
Full Changelog: v1.5.3...v1.5.4