Skip to content
Discussion options

You must be logged in to vote

Hi @phil714,
if you take a closer look, only the initialization of the i18nObject is asynchronos. So you basically would only need to initialize it somewhere and then you could use it in a synchronos way.

I think you just have to use the "raw" i18nObject function exported from i18n-util.ts in addition to the react adapter (you must initialize each version separately).

If you can't make asynchronos calls, you can always import the i18nObject from typesafe-i18n directly. See here how to initialize it. Just make sure to pass the generated Types as Generics when initializing it to get full typesafety support.

Your code will look something like this:

import { i18nObject } from 'typesafe-i18n'
i…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by phil714
Comment options

You must be logged in to vote
2 replies
@ivanhofer
Comment options

@phil714
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants