Closed jean-francine closed 4 years ago
I used ApiPlatformTranslationBundle with symfony 4.3
Hi @jean-francine I think the problem is in ReferenceMateriel constructor. You didn't call parent constructor, so locale isn't set at all. Also, you don't need to initialise translations collection, since it is done in AbstractTranslatable class. This is what constructor should look like if you wish to use it in your class:
public function __construct() {
parent::__construct();
//...
}
Please let me know if this helps.
Thanks you for the quick reply ! Unfortunately that does not solve the problem. I have the following lines which are the defaults setting in the file config/packages/translation.yaml :
framework: default_locale: en translator: default_path: '%kernel.project_dir%/translations' fallbacks:
is this the correct setting ?
@jean-francine can you check if https://github.com/Locastic/ApiPlatformTranslationBundle/pull/19 fixed your problem by pulling the latest version of the bundle?
Hi @paullla ! I just updated the bundle and it works like a charm ! Thank you so much !!
Thank you for your feedback :) Closing the issue.
Hello,
I’m trying to use LocasticApiTranslationBundle with doctrine but I’m unable to make it work.
it tells me that there is no locale defined but I don't know where to declare the locale ?
Can you help me and tell me what I’m doing wrong please ?
In attachment, the stacktrace,
the source entity (ReferenceMateriel) and the translation entity (ReferenceMaterielTranslation) I use.
Thank you in advance for your help.
Best regards
ReferenceMateriel.txt ReferenceMaterielTranslation.txt stacktrace.txt