I have this translation:
unit-days =
{ $value ->
[one] { $value } <abbr title="day">d</abbr>
*[other] { $value } <abbr title="days">d</abbr>
}
which I'm trying to wire up like this:
// This is taking place inside a loop, hence the `key={unit}` and generated translation `id`
<Localized
key={unit}
id={`unit-${unit}`}
vars={{ value }}
elems={{
abbr: <abbr />,
}}
>
<span className="whitespace-nowrap" />
</Localized>
and for the most part it works, except it renders as
<span class="whitespace-nowrap">59 <abbr>y</abbr></span>
instead of
<span class="whitespace-nowrap">59 <abbr title="years">y</abbr></span>
How do I shuttle that title into there from the translation? I'd prefer to not get l10n.getString involved, as that decouples the translation from the context. If there's a way to do this with fluent properties that'd also be fine, but as far as I can tell, the attrs on Localized only applies to the root element, not the elems elements. Right?
I have this translation:
unit-days = { $value -> [one] { $value } <abbr title="day">d</abbr> *[other] { $value } <abbr title="days">d</abbr> }which I'm trying to wire up like this:
and for the most part it works, except it renders as
instead of
How do I shuttle that
titleinto there from the translation? I'd prefer to not getl10n.getStringinvolved, as that decouples the translation from the context. If there's a way to do this with fluent properties that'd also be fine, but as far as I can tell, theattrsonLocalizedonly applies to the root element, not theelemselements. Right?