I try with the command line bin/cake i18n extract. POT files are generated correctly in the folder /src/Locale/fr, but I still get 'accueil_main_title" on my view.
You should have a default.pot at /src/Locale, and default.po and default.mo in /src/Locale/fr. After this You should open your /src/Locale/fr/default.po file with Poedit, refresh it from your pot file, do a translation. Delete your cake cache, and after that it should work.
I would reccomend you to do not use placeholder texts. Just pick up a base language and use it. So what I would do is use __(‘Welcome’) instead of __(‘accueil_main_title’).
By that you have a default language what does not require translation and that will be the fallback for all non translated texts. In this case English will go to your pot file.
I use placeholder because I want to translate a full paragraph and not only one word. For instance in my view I wrote something like this :
__(‘Accueil_paragraph_1’)
and then in the po file I have this:
msgid “Accueil_paragraph_1”
msgstr “Lorem ipsum dolor fse sit amet, consectetur adipiscing elit. Duis eu imperdiet lorem, non tincidunt nibh. Phasellus quis massa eget erat tempus interdum id ut sem. Nam tristique purus massa, et scelerisque urna rutru…”
I would not do that. Why do not you put there the whole paragraph? From your placeholder nobody will know (exept you) what to put there as a translation. That is why we use a default language.