Closed Megamannen closed 6 months ago
Hey, I think it's wanted behavior. Because i18next can have multiple backends and it tries to load that until it gets something else than undefined
from the backend.
There can be case, where you want to search for data elsewhere when Tolgee doesn't have them. If I'd return empty array, I block the fallback, which is IMHO undesired.
But I guess it shouldn't throw an error, that I'll fix
Yeah, in that case something like
const translations = await tolgee.loadRecord({
language,
namespace: ns,
});
callback(null, translations ? Object.fromEntries(translations) : undefined);
This function can return a undefined and will cause an exception
So this line crashes: https://github.com/tolgee/tolgee-js/blob/91fa105da2279e5e3317091ef816b88b5f0a3dd8/packages/i18next/src/tolgeeBackend.ts#L15
This is maybe the wanted behaviour, but I don't know if you want to solve it "upstream"