Skip to content

Bug: ICU MessageFormat select is parsed incorrectly #602

@bennajah

Description

@bennajah

When using an ICU select message in messages/en.json, the generated TypeScript output is incorrect. The key name is parsed incorrectly and the resulting function is unusable.

messages/en.json

{
  "$schema": "https://inlang.com/schema/inlang-message-format",
  "mode": "{mode, select, light {Light} dark {Dark} system {System} other {Unknown}}"
}

src\lib\paraglide\messages\en.js

export const mode = /** @type {(inputs: { "mode, select, light {Light": NonNullable<unknown>, Dark: NonNullable<unknown>, System: NonNullable<unknown>, Unknown: NonNullable<unknown> }) => LocalizedString} */ (i) => {
	return /** @type {LocalizedString} */ (`Unknown`)
	return /** @type {LocalizedString} */ (`${i?.["mode, select, light {Light"]} dark ${i?.Dark} system ${i?.System} other ${i?.Unknown}}`)
};

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions