Closed TomDeSmet closed 1 year ago
Did you try to invalidate the "Element API responses" cache here (after adding the translation in /admin/translations-admin)? /admin/utilities/clear-caches
I'm not caching my Element API responses as it's still in development. And it's not returning old data, it just returns the translation key.
Would you be able to send the database, composer.json/composer.lock and the config/element-api.php file to support@mutation.io to be able to reproduce the problem? Thanks.
Sorry for my late answer, I didn't have the time yet to follow this up, BUT I think I just made a stupid mistake. I only added the translation to the PHP file and didn't sync it with the plugin yet. So it seems this is not a bug at all but a human error on my side.
We're using this plugin so the client can add their own translations to the website, but I also need translations in the Element API plugin. Using
Craft::t("site", "MyString")
does not work when this plugin is enabled. So it seems I cannot use translations outside of Twig anymore. I can't find anything in the docs to make this work.