l10n plurals in HTML using SDK

I’m wondering if it’s possible to use l10n plurals in HTML using the SDK. I’m going to be using a counter and I’d like it to show the correct pluralization if possible.

I use xhtml and dtd files and I havent been able to find a way. Does sdk also use dtd?

You create an (X)HTML file, so you can do it however you want. I didn’t think there’d be a way, but I wasn’t sure if there was something like data-l10n-id-num I could use.

I use Cu.import('resource://gre/modules/PluralForm.jsm'); in a bootstrapped add-on.

1 Like

Oh wow I never knew of this, this is awesome! https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals

Yeah, I may need to do the output in Javascript, which won’t be as nice.