I followed the documentation and implemented localization in the plugin using JSON files like de.json and en.json. Unfortunately, it’s not working.
I tried the same thing the classic way with en/lang.php, and that works. Localization within the app folder using either JSON or PHP also worked.
Is this a global issue, or am I doing something wrong?
my json example de.json
Path: plugins/author/name/lang/de.json
Sorry, I only noticed your path refers to the plugin directory, and the translations are accessed in the theme. The theme doesn’t load all the JSON translations for performance reasons.
The solution is to place the translations in Theme language directory, for example:
themes/name/lang/de.json
Let me know if this solution works for you. Otherwise, we’ve noticed another user also had this same issue and was confused by it as well. As a solution, we could include a way to overcome it using the CMS configuration files. When enabled, the configuration would load all the plugin messages, which may be suitable for smaller sites, yet could impact larger sites at scale.