You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewRuntimeException('No translatable attributes annotated with @Polyglot\Translatable were found');
seem to harsh to me.
Sometimes I want to deploy some preparation for translations (namely the *Translatable entity and it's migration) early, so that the migration is executed in the production database and clients can start translating content, before the code is fully functioning. When I do the preparation lazily, I might add @Polyglot\Locale at the class level, but miss to @Polyglot\Translatable at the appripriate attributes - and don't think twice about it, as I know the code does not need to work right now. This results in the RuntimeException.
Having missed adding an annotation is nothing I would expect to result in a RuntimeException. If there are no appropriate tests, this might slip through into production.
Hence I think about reducing this RuntimeException to a log message. If I don't get a translation as expected, the logs might be one of the last places I would look at, but the entity attribute or the README instructions of this bundle seem to be reasonable as first points of contact, so this might be enough?
I do understand your valid case and would also log the message instead of throwing an Exception. To hint this in the README should also be done as you mentioned.
The RuntimeException thrown in
WebfactoryPolyglotBundle/src/Doctrine/TranslatableClassMetadata.php
Line 166 in f632d19
Sometimes I want to deploy some preparation for translations (namely the
*Translatable
entity and it's migration) early, so that the migration is executed in the production database and clients can start translating content, before the code is fully functioning. When I do the preparation lazily, I might add@Polyglot\Locale
at the class level, but miss to@Polyglot\Translatable
at the appripriate attributes - and don't think twice about it, as I know the code does not need to work right now. This results in the RuntimeException.Having missed adding an annotation is nothing I would expect to result in a RuntimeException. If there are no appropriate tests, this might slip through into production.
Hence I think about reducing this RuntimeException to a log message. If I don't get a translation as expected, the logs might be one of the last places I would look at, but the entity attribute or the README instructions of this bundle seem to be reasonable as first points of contact, so this might be enough?
WDYT, @mpdude @FabianSchmick ?
The text was updated successfully, but these errors were encountered: