(el: PluralElement)
| 231 | } |
| 232 | |
| 233 | function printPluralElement(el: PluralElement) { |
| 234 | const type = el.pluralType === 'cardinal' ? 'plural' : 'selectordinal' |
| 235 | const keys = Object.keys(el.options).sort((a, b) => { |
| 236 | const [pa, sa] = getPluralRuleSortOrder(a) |
| 237 | const [pb, sb] = getPluralRuleSortOrder(b) |
| 238 | return pa - pb || sa - sb |
| 239 | }) |
| 240 | const msg = [ |
| 241 | el.value, |
| 242 | type, |
| 243 | [ |
| 244 | el.offset ? `offset:${el.offset}` : '', |
| 245 | ...keys.map(id => `${id}{${doPrintAST(el.options[id].value, true)}}`), |
| 246 | ] |
| 247 | .filter(Boolean) |
| 248 | .join(' '), |
| 249 | ].join(',') |
| 250 | return `{${msg}}` |
| 251 | } |
no test coverage detected