1

I'm using DoctrineExtensions in order to get my entities translated. It works really fine, but i don't know how to resolve this issue :

I use translation fallback, personal translations and ORM query hint in order to reduce DB queries. If the translation doesn't exist, so it will fallback to default values. Till here, there's no problem.

But (this is my question) how could I know that entity has fallen back into the default values ? I mean, if an entity has no translation, is there a way to check it ?

For example, if we want to process this entity somehow whenever there's no translation. Something like :

if (!entity.isTranslated) {
   //do something here
}

Of course, just for simplicity, we consider that all fields have been translated or not.

I hope I've been clear enough.

Thanks

1 Answers1

0

I don't think you can do it for now (v2.*).

There is a big refactoring for v3.0, in Translatable there will be no default locale anymore.

See the pull request here: https://github.com/l3pp4rd/DoctrineExtensions/pull/764

no more default locale, all locales are persisted as translations, translatable entity fields serve only as proxy and representation

Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261