Prompt
notification templates variables localization
Latest observation
Oct 13, 2026
OpenAI APIWeb search: off
If you’re looking for notification template variables localization, the general idea is:
-
Keep variables language-neutral
- Examples:
{{user_name}},{{order_number}},{{deadline}} - These values come from data and usually don’t need translation themselves.
- Examples:
-
Localize the surrounding text
- Example in English:
Hello {{user_name}}, your order {{order_number}} has shipped. - Example in Spanish:
Hola {{user_name}}, tu pedido {{order_number}} ha sido enviado.
- Example in English:
-
Use locale-specific formatting for variable values
- Dates:
2026-10-13→13 Oct 2026/13 oct. 2026 - Currency:
$1,250.00/1.250,00 € - Numbers, plurals, and names of days/months should follow locale rules
- Dates:
-
Support pluralization and gender where needed
- Example:
You have 1 new messageYou have 5 new messages
- Best handled with an i18n framework rather than hardcoded strings
- Example:
-
Don’t translate placeholders themselves
- The token names should stay stable across languages
- Example: use
{{first_name}}, not localized placeholder names per language
-
If templates are editable by translators
- Use a translation system that protects variables from being changed
- Example formats:
Hello {user_name}Hello {{user_name}}- ICU MessageFormat:
Hello {user_name}, you have {count, plural, one {# message} other {# messages}}
Recommended approach
Use:
- message templates per locale
- data variables passed separately
- ICU MessageFormat or similar i18n tooling for pluralization and interpolation
Example
English
Hi {{user_name}}, your appointment is on {{appointment_date}}.
French
Bonjour {{user_name}}, votre rendez-vous est le {{appointment_date}}.
With appointment_date formatted by locale:
- English:
Oct 13, 2026 - French:
13 oct. 2026
If you want, I can also provide:
- a schema for localized notification templates
- best practices for variable naming
- or examples for a specific platform like React, Django, Laravel, or SendGrid.