Private Information
A brief overview of working with Private Information in GT.
Overview
Private information is generally any information that should remain private. For example, a user's National Insurance number (NIN), Tax Identification Number (TIN), or email address.
To keep this information private during translation, we use the <Var> component.
The <Var> component wraps any content that should not be shared,
and the content inside the <Var> component will always remain unchanged.
This is ideal for names, emails, addresses, etc.
Sometimes we do want to display private information, but we still need to reformat it based on the user's preferred languages, regional regulations, etc.
For example, we might want to display a user's bank account balance in their local currency.
In these cases, we instead use either <Currency>, <DateTime>, or <Num> components.
Example
The <Var> component is also useful for displaying confidential information.
import { T, Var } from 'gt-next'
export default function PrivateInfo(email) {
return (
<T id='private-info'>
Your email address is <Var>{email}</Var>.
</T>
);
}The children of the <Var> component won’t be translated.
Its contents will never be passed to the General Translation API.
How is this guide?