Skip to content

Releases: CreativeNative/translation-bundle

v2.0.1

10 Feb 17:45

Choose a tag to compare

Bug Fix

  • Fix unresolved %kernel.default_locale% parameter referenceprocessConfiguration() does not resolve Symfony %param% references, so the default_locale validation against enabled_locales always failed when left at its default. Now resolved via ParameterBag::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

10 Feb 16:22

Choose a tag to compare

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 returns Tuuid (non-nullable) — remove any null checks
  • Bundle reads locales from Symfony's framework.enabled_locales — remove tmi_translation.locales
  • Config flattened: logging.enabled → root-level enable_logging

See UPGRADING.md for migration guide with before/after examples.

New Features

  • Translation Cache ServiceTranslationCacheInterface with InMemoryTranslationCache (default) and Psr6TranslationCache implementations
  • Type-Safe EmptyOnTranslate Defaults — Non-nullable scalars get zero-values (string"", int0, float0.0, boolfalse) instead of throwing exceptions
  • Fallback Controlcopy_source config option (default: false) with per-entity #[Translatable(copySource: true)] override
  • Compile-Time ValidationAttributeValidationPass catches attribute conflicts at container build; TranslatableEntityValidationWarmer validates unique constraints at cache:warmup

Quality

  • 409 tests, 2674 assertions
  • 100% code coverage (1054/1054 lines)
  • PHPStan level max (0 errors)
  • Zero @phpstan-ignore annotations

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

08 Feb 21:37

Choose a tag to compare

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-ignore annotations — 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: max in phpstan.neon, single composer stan command

Type Safety

  • Handler chain verified: All 10 handlers have explicit type narrowing at every getDataToBeTranslated(), getProperty(), and getTranslatedParent() call site
  • ORM 3 typed API migration: All handler association access uses instanceof InverseSideMapping/OwningSideMapping with 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, failOnRisky all 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 to array<string, array<string, mixed>>
  • TranslatableTrait::$translations property type narrowed to match
  • Typed accessor methods on test base classes for null-safe property access
  • EntityTranslatorInterface enhanced with full @param/@return PHPDoc

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 @var annotations, dead imports, and unused code removed

Full Changelog: v1.8.0...v1.8.1

v1.8.0 Validation & Safety

06 Feb 20:05

Choose a tag to compare

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 + EmptyOnTranslate on the same property now throws a LogicException with a clear, actionable error message including code examples
  • Readonly validation: EmptyOnTranslate on a readonly property throws a LogicException at translation time with solution suggestions
  • Exception hierarchy: New ValidationException, AttributeConflictException, ReadonlyPropertyException, and ClassLevelAttributeConflictException — all with detailed heredoc messages

Embedded Object Improvements

  • Per-property resolution: EmbeddedHandler rewritten 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: EntityTranslator accepts an optional LoggerInterface — 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.enabled option (default: true)

Internal

  • 14 atomic commits across 5 plans
  • 275 test methods, PHPStan level 1 clean
  • EntityTranslator embedded processing simplified from 22 lines to 8 lines

Full Changelog: v1.7.0...v1.8.0

v1.7.1 - Documentation restructuring

03 Feb 18:34

Choose a tag to compare

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

02 Feb 21:13

Choose a tag to compare

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

29 Nov 10:52

Choose a tag to compare

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 @EmptyOnTranslate validation 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 uses ReflectionProperty::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

28 Nov 21:00

Choose a tag to compare

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

15 Nov 11:05

Choose a tag to compare

What's Changed

  • Updated: GitHub workflow creates var/cache folder before composer install.
  • Removed: Composer post-install-cmd and post-update-cmd hooks.
  • 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

15 Nov 11:00

Choose a tag to compare

What's Changed

  • Updated: GitHub Actions workflow to create var/cache and 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