awaitForTranslation() (deprecated)
caution
Deprecated since 3.5.0. awaitForTranslation is now an alias of
awaitForTranslationOrThrow — identical behaviour, same
signature, same rejection on failure. It will be removed in 4.0.0.
Migrate today by renaming the import:
- Request handlers, server components, API responses, emails, notifications →
awaitForTranslationOrFallbackToOriginal(never rejects, falls back to the original text on failure). - Scripts, build steps, migrations →
awaitForTranslationOrThrow(same behaviour as this function, just under its own name).
Enable the @typescript-eslint/no-floating-promises lint rule to catch a missing await
during the migration.
Related
- awaitForTranslationOrFallbackToOriginal() - use in request handlers
- awaitForTranslationOrThrow() - use in scripts and build steps
- I18nKeyless.init() - Initialize the library
- Types - Type definitions