I have a translate("") function and I want PhpStorm to start suggesting values from a JSON file when I start typing between the quotes.
The idea is that I have a JSON file with translation strings and when I start typing it should suggest translations which are already included in that json file, based on the characters I already typed of course.
After some research, I do not think this is currently possible in PhpStorm, but maybe someone here has an idea or an alternative.
Thanks!
I made it work using PhpStorm advanced metadata.
I created a
.phpstorm.meta.phpfile in the project root, this will add auto completion/suggestions for the first (0) argument of thetranslatemethod:And then wrote a Symfony command that takes strings from my translation file and includes them between the two
/* Generated */comments:This solution was written with PHP using Symfony 6.3
The suggestions will look like this in the IDE: