Astrotomic / laravel-translatable

A Laravel package for multilingual models
https://docs.astrotomic.info/laravel-translatable/
MIT License
1.22k stars 153 forks source link

Empty Translation row if locale not in data. #349

Closed alemodis closed 1 year ago

alemodis commented 1 year ago

Hello,

I Have and issue with the package

Problem:

When using the translatable package, an empty "en" translation is created even if the only translations provided in the data are for other languages, such as "el" and "elen". This happens even when the package configuration has "en" listed as a fallback locale.

Expected behavior:

The translatable package should not create an empty "en" translation when the only translations provided in the data are for other languages.

Steps to reproduce:

  1. Install the translatable package and configure it as desired.
  2. Use the Translatable trait in a model and add some translated fields.
  3. Create an instance of the model and set translations for only some languages (e.g. "el" and "elen").
  4. Save the model to the database.
  5. Check the database and notice that an empty "en" translation has been created even though there was no translation provided for that language.
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days