Add context for better translations
Translations are automatically made with AI. AI is very clever, but sometimes is less clever than you, and YOU know which translation suits for a specific case. You have two options to force the translation
- go on your dashboard and change the translation in your interface
- if you're coding right now, just do it from your code
- React (web)
- React Native
- Node.js
import { I18nKeylessText } from "i18n-keyless-react";
return (
<I18nKeylessText forceTemporary={{ en: 'Back' }}>
Retour
</I18nKeylessText>
);
}
import { getTranslation } from "i18n-keyless-react";
return (
<p>
{getTranslation('Retour', { forceTemporary: { en: "Back" } })}
</p>
);
}
import { I18nKeylessText } from "i18n-keyless-react";
return (
<I18nKeylessText forceTemporary={{ en: 'Back' }}>
Retour
</I18nKeylessText>
);
}
import { getTranslation } from "i18n-keyless-react";
return (
<p>
{getTranslation('Retour', { forceTemporary: { en: "Back" } })}
</p>
);
}
warning
awaitForTranslation NEED to be awaited, to prevent 429 to happen.
import { awaitForTranslation, type Lang } from 'i18n-keyless-node';
async function sendNotificationsToUsers() {
// ...
const title = await awaitForTranslation(
"Viens voir l'application",
user.lang as Lang,
{ forceTemporary: "Come and check my app!"}
);
// ...
}