Template strings and templates

Andreas Rossberg rossberg at google.com
Fri Mar 7 00:31:37 PST 2014

On 7 March 2014 08:40, Axel Rauschmayer <axel at rauschma.de> wrote:
> // Localization and formatting
> l10n`Hello ${name}; you are visitor number ${visitor}:n! You have ${money}:c
> in your account!`
> A correct German translation of this would have to take the gender of the
> visitor into consideration:
> Male: l10n`Hallo, Herr ${name}; Sie sind Besucher Nummer ${visitor}:n. Sie
> haben ${money}:c auf Ihrem Konto.`
> Female: l10n`Hallo, Frau ${name}; Sie sind Besucherin Nummer ${visitor}:n.
> Sie haben ${money}:c auf Ihrem Konto.`
> How would you do that with template strings?
> The English version could be used as a key to look up the international
> version. You could also reorder the pieces. A bit of work for a library, but
> template strings would help, a little.

I wish I could just link to Google's internal i18n course material to
give an idea of how far, far, far more difficult this problem is.
Template strings are rather a distraction in that space.


More information about the es-discuss mailing list