Repository navigation
Replies: 2 comments 1 reply
|
Hi @marekbrze, this discussion somehow slipped our fingers. Are you still experiencing the issue? |
|
I ran into the same thing and checked it against 1. With You can turn those events into a build failure: import { Tolgee, DevTools } from "@tolgee/web";
import { FormatIcu } from "@tolgee/format-icu";
export const tolgee = Tolgee()
.use(DevTools())
.use(FormatIcu())
.init({
defaultLanguage: "pl",
availableLanguages: ["pl", "en"],
availableNs: ["cafes", "nav"],
apiUrl: "MY URL",
apiKey: import.meta.env.MY_KEY,
});
const errors: Error[] = [];
const sub = tolgee.on("error", ({ value }) => errors.push(value));
await tolgee.run();
await tolgee.loadMatrix({ languages: "all", namespaces: "all" });
sub.unsubscribe();
if (errors.length) {
throw new AggregateError(errors, "Tolgee: failed to load translations");
}Each error is a 2. In a production build, import { Tolgee, DevBackend } from "@tolgee/web";
import { FormatIcu } from "@tolgee/format-icu";
// ...
Tolgee().use(DevBackend()).use(FormatIcu()).init({ /* same options */ });With If the build only needs the translations (no in-context editing), an alternative is to pull them with the Tolgee CLI before the build and pass them as What I tested (Node 20,
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I am building astro.js website and I want to interrupt build if there is any error with tolgee (wrong API key etc).
What is the best way to do it?
I tried to find any information in the docs about return values of function etc, but I couldn't find anything
My current code:
All reactions