unsplash / intlc

Compile ICU messages into code. Supports TypeScript and JSX. No runtime.
MIT License
56 stars 2 forks source link

Flattening broken #184

Closed samhh closed 1 year ago

samhh commented 1 year ago

Pulled a 0.6 release after discovering this. Regression since 0.5.0.

Relevant:

It seems to be specific to plurals:

$ cat x.json
{
  "cardinal": {
    "message": "{n, plural, one {# photo} other {# photos}}",
  },
  "ordinal": {
    "message": "{n, selectordinal, one {# photo} other {# photos}}",
  },
  "select": {
    "message": "{x, select, one {one photo} other {many photos}}",
  }
}
$ intlc flatten x.json | jq .
{
  "cardinal": {
    "message": "{n, plural, one {#} other {#}}",
    "backend": "ts",
    "description": null
  },
  "ordinal": {
    "message": "{n, selectordinal, one {#} other {#}}",
    "backend": "ts",
    "description": null
  },
  "select": {
    "message": "{x, select, one {one photo} other {many photos}}",
    "backend": "ts",
    "description": null
  }
}
samhh commented 1 year ago

It's an issue with plural refs specifically.

samhh commented 1 year ago

https://github.com/unsplash/intlc/commit/9e8de6d0a3a4a2a43c1e47b13a03e34a2ea5b5d2