-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just added this test for more coverage on this file
@@ -113,7 +265,7 @@ describe("createCompiledCatalog", () => { | |||
{ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier changes (this and the following)
@@ -50,20 +50,20 @@ describe("PseudoLocalization", () => { | |||
it("with HTML tags", () => { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -92,4 +92,14 @@ describe("PseudoLocalization", () => { | |||
expect(pseudoLocalize("replace {count}")).toEqual("ŕēƥĺàćē {count}") | |||
expect(pseudoLocalize("replace { count }")).toEqual("ŕēƥĺàćē { count }") | |||
}) | |||
|
|||
it("multiple plurals pseudolocalize gives wrong ICU message", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
&addDelimitersMacro
and keep only the handling of HTML inside thepseudoLocalize.ts
code