Skip to content

v3.1.0

Choose a tag to compare

@izakgl izakgl released this 16 Jul 10:43
· 8 commits to main since this release
5b6d71e

What's Changed

Migrate translations setup

setTranslateFunction was removed. Use configureTranslations instead.

1. Add configureTranslations in config/i18n.ts

At the end of the file, after i18n.init().

import { configureTranslations } from "@povio/openapi-codegen-cli";

// ...existing i18n setup...

configureTranslations(() => i18n.t.bind(i18n));

2. Remove old wiring from pages/__root.tsx

By default, projects wire translations in pages/__root.tsx via a useEffect that calls setTranslateFunction. Remove it:

useEffect(() => {
  if (typeof t === "function") {
    AppErrorHandler.setTranslateFunction(t);
  }
}, [t]);

configureTranslations is global and applies to all error handlers, including SharedErrorHandler.

Full Changelog: v3.0.1...v3.1.0