unsplash / intlc

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

Fix dangling space in ICU compiler literal plural output #139

Closed samhh closed 2 years ago

samhh commented 2 years ago

Fixes #97.

Given via intlc flatten:

{
  "f": {
    "message": "{n, plural, =1 {}}"
  }
}

Before:

{"f":{"message":"{n, plural, =1 {} }","backend":"ts","description":null}}

After:

{"f":{"message":"{n, plural, =1 {}}","backend":"ts","description":null}}

I'm going to be lazy and not add a test for this on the basis that:

  1. It's not a major bug if it happens again.
  2. Testing is tracked as part of a larger issue at #49, sort of.
  3. Testing is really implicitly tracked by #129 which will presumably rely upon this very ICU compiler.