fix: Make pseudolocal use the message AST instead of the key#1293
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| }) | ||
|
|
||
| describe("createCompiledCatalog", () => { | ||
| it("nested message", () => { |
There was a problem hiding this comment.
just added this test for more coverage on this file
| Hello: "Ahoj", | ||
| Missing: "", | ||
| Select: "{id, select, Gen {Genesis} 1John {1 John} other {____}}" | ||
| Select: "{id, select, Gen {Genesis} 1John {1 John} other {____}}", |
There was a problem hiding this comment.
prettier changes (this and the following)
| expect( | ||
| pseudoLocalize( | ||
| "{count, plural, zero {There's # <span>message</span>} other {There are # messages}" | ||
| "{count, plural, zero {There's # <span>message</span>} other {There are # messages}}" |
There was a problem hiding this comment.
these weren't valid ICU messages (it does not make the tests failed, since these tests does not validate it's a valid ICU message), but still need to be correct (unless we'll remove the ICU handling from this file)
7097313 to
5b3b6a8
Compare
| expect(pseudoLocalize("replace { count }")).toEqual("ŕēƥĺàćē { count }") | ||
| }) | ||
|
|
||
| it("multiple plurals pseudolocalize gives wrong ICU message", () => { |
There was a problem hiding this comment.
this is the test that shows why the currently implemented ICU support in pseudoLocalize.ts is wrong
Codecov ReportBase: 81.67% // Head: 82.08% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1293 +/- ##
==========================================
+ Coverage 81.67% 82.08% +0.41%
==========================================
Files 56 56
Lines 1779 1781 +2
Branches 495 496 +1
==========================================
+ Hits 1453 1462 +9
+ Misses 196 192 -4
+ Partials 130 127 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This is fixing this issue: #1213
I'm not sure why in this PR (#1165) there was a change from the message to the key, but I hope I don't mess anything
Also, I wonder if we should remove the
addDelimitersVariables&addDelimitersMacroand keep only the handling of HTML inside thepseudoLocalize.tscode