I had the same issue today and used this tutorial [https://next-intl.dev/docs/getting-started/app-router/with-i18n-routing] to resolve it. It is a library that wraps your dictionaries in a server-side module, then makes its properties visible to your client-side components.
If you insist on a custom implementation, I would recommend doing the same thing. Also, if you find a way to make the generated pages static, let me know.