Skip to content

Translations not loaded after migration to Next 15 #3434

@empz

Description

@empz

My current setup uses Next 14 + next-intl and it works great.

I need to upgrade to Next 15, so I've followed the sample repo here: https://github.com/tolgee/next-app-intl-example

After quite some struggle, I got it to work in dev mode with some deprecation warnings.

Problem is, running a production build results in the Tolgee keys being displayed instead of actual translations.

What could be the reason for this?

My TolgeeBase function from src/tolgee/shared.ts

export function TolgeeBase() {
  return Tolgee()
    .use(FormatIcu())
    .use(DevTools())
    .updateDefaults({
      apiKey,
      apiUrl,
      fallbackLanguage: "en",
      defaultNs: "www",
      staticData: {
        en: () => import("../../messages/www/en.json"),
        es: () => import("../../messages/www/es.json"),
        fr: () => import("../../messages/www/fr.json"),
        de: () => import("../../messages/www/de.json"),
        hi: () => import("../../messages/www/hi.json"),
        ja: () => import("../../messages/www/ja.json"),
        ko: () => import("../../messages/www/ko.json"),
        "zh-Hans": () => import("../../messages/www/zh-Hans.json"),
      },
    });
}

All my translations files are indeed present in messages/www

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions