Skip to content

Releases: Locastic/ApiPlatformTranslationBundle

v2.0.1

Choose a tag to compare

@paullla paullla released this 07 Jul 12:52
b36d0c5

Patch release fixing a regression introduced by the translation write reconciliation in v2.0.0.

Fixed

Translations referenced by IRI (when the translation entity is exposed as its own ApiResource) are again resolved by API Platform's native denormalization (#83). v2.0.0 intercepted such payloads and silently dropped the references, which on PUT removed every existing translation.

The embedded locale-keyed shape documented in the README was not affected; if you only ever send "translations": {"en": {...}, "de": {...}}, v2.0.0 and v2.0.1 behave identically.

Full changelog: v2.0.0...v2.0.1

v2.0.0

Choose a tag to compare

@paullla paullla released this 07 Jul 12:24
049e721

v2.0.0 restores honest versioning and wide platform support after the mis-tagged v1.4.1, and fixes the long-standing translation write behavior.

See UPGRADE-2.0.md for step-by-step upgrade instructions.

Highlights

Translation writes reconciled in place (#81)

Nested translation writes no longer recreate the whole collection. Each submitted locale updates its existing translation row, keeping ids stable and unique constraints intact (fixes #61, the root cause behind #36 and #54):

  • PATCH (application/merge-patch+json) updates the submitted locales and leaves the others untouched. This is the recommended way to edit translations and needs no configuration.
  • PUT is a full replace: locales absent from the payload are removed. PUT requires API Platform's standard_put to be disabled, per operation (extraProperties: ['standard_put' => false]) or globally (api_platform.defaults.extra_properties.standard_put: false). A misconfigured PUT fails with an explicit error telling you exactly that, instead of an obscure Doctrine exception.

Wide platform support restored (#76)

v1.4.1 silently raised the floor to PHP 8.4 and API Platform 4.2. v2.0.0 goes back to supporting the platforms the code actually runs on:

v1.4 v1.4.1 v2.0.0
PHP ^8.1 >=8.4 ^8.2
API Platform ^2.1 || ^3.0 ^4.2 ^3.4 || ^4.0
Doctrine ORM ^3.0 ^3.5 ^3.0

API Platform 2 users: stay on v1.4; critical fixes land on the new 1.x branch.

Locale validation (#71)

When framework.enabled_locales is configured, requested locales outside the list (?locale= or Accept-Language) now fall back to the default locale instead of being accepted verbatim. Thanks @maxhelias for the contribution.

Breaking changes

All breaking changes are listed in the CHANGELOG with upgrade steps in UPGRADE-2.0.md:

  1. Dependency floors (PHP ^8.2, api-platform/symfony, Doctrine ORM 3).
  2. Translator implements LocaleAwareInterface and declares parameter types.
  3. AssignLocaleListener signatures use Doctrine\Persistence\Event\LifecycleEventArgs.
  4. Out-of-list locales fall back to the default locale when enabled_locales is set.
  5. Translation writes are reconciled in place; PUT needs standard_put disabled.

Quality

  • PHPStan level 6 and php-cs-fixer enforced in CI (#78)
  • CI matrix: PHP 8.2 to 8.5 plus a lowest-dependencies leg (#76)
  • Model edge-case tests and a kernel smoke test booting Framework + Doctrine + API Platform (#80)
  • Modernized README with attribute-based examples (#77), community files (#79)

Thanks to @maxhelias and @tacman for their contributions.

API Platform V4 and Symfony V7.4 support

Choose a tag to compare

@paullla paullla released this 18 Dec 12:29
0b6951a

What's Changed

New Contributors

Full Changelog: v1.4...v1.4.1

Doctrine 3.0 support

Choose a tag to compare

@paullla paullla released this 10 May 12:27
d0baefc
orm 3.0 support (#68)

* oem3.0 support

* bump php requirement to 8.1

* remove php 8.0 & add 8.3 in gh workflow

Translations loading improvement

Choose a tag to compare

@paullla paullla released this 08 Dec 08:53
09437e2
Initialize proxy objects if necessary (#64)

Co-authored-by: Alex C <alex.canals@jkweb.ch>

Handle doctrine/collection:^2

Choose a tag to compare

@paullla paullla released this 10 Jul 17:43
94afdf4

Handle doctrine/collection:^2

Support for PHP 8

Choose a tag to compare

@paullla paullla released this 04 Mar 08:33
e88d320
Upgrade requirements to php8 (#39)

* Upgrade requirements to php8

* Bump travis ci version to 8.0

* Bump travis ci version to 8.0

* Bump travis ci version to 8.0.2

* Bump travis ci ubuntu version to xenial

Minor fixes

Choose a tag to compare

@paullla paullla released this 22 Oct 12:40
79fcf8b
  • fix conflicts with symfony/translations-contracts <2.0
  • fixed doctrine listener arguments for new doctrine version
  • small code cleanup

Strict types fixes and documentation improvements

Choose a tag to compare

@paullla paullla released this 15 Jun 08:10
443d3ec
Improve documentation and update PhpDoc and method signatures (#22)

* Add missing information about Doctrine relationship.

* Don't allow empty parameter on setters of Translation objects.

* Cleanup some PhpDoc and method signatures

* Update README.md

Co-authored-by: Ashura <dominik.mueller@jkweb.ch>

Fixed default locale parameter and added symfony-bundle tag

Choose a tag to compare

@paullla paullla released this 18 Feb 10:41
8666a41
  • added tag "type": "symfony-bundle" to composer.json
  • switched "locale" parameter in services.yml to "kernel.default_locale"