Pseudolocalization fails with exact or offsetting plurals
See original GitHub issueDescribe the bug
When using exact or offsetting plurals, pseudolocalization fails with an error:
Error: Can't parse message. Please check correct syntax: "{mēśśàĝēśĆōũńţ, ƥĺũŕàĺ, =0 {Ţĥēŕē'ŕē ńō mēśśàĝēś} one {Ţĥēŕē'ś # mēśśàĝē ĩń ŷōũŕ ĩńƀōx} other {Ţĥēŕē'ŕē # mēśśàĝēś ĩń ŷōũŕ ĩńƀōx}}"
To Reproduce
- Enable pseudolocalization in config
- Add exact or offsetting plurals as documented https://lingui.js.org/ref/message-format.html
- Run
npm run compile
import { Plural } from "@lingui/macro"
export default function App() {
return <Plural
value={messagesCount}
_0="There're no messages"
one="There's # message in your inbox"
other="There're # messages in your inbox"
/>
}
Expected behavior The plural strings are correctly pseudolocalized
Additional context Appears to be similar to #427, the regex for plurals is tricky to get right
- jsLingui version
2.7.4
- Babel version
babel-core@7.0.0-bridge.0
- Create React App
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Pseudo-Localization: What It Is and Why It Matters - Shopify
This adaptation happens by translating text and adding locale-specific components. Internationalization and localization are connected, and one ...
Read more >The Ultimate Guide to Android Localization | Phrase
Explore best practices for Android localization and learn how to translate your app into multiple languages for international success.
Read more >@lingui/conf | Yarn - Package Manager
... macro underscore type (#884 (5cade19); plural pseudolocalization with offset (#887 (3d54b4d) ... show error when plurals aren't loaded (#824 (296b6a1) ...
Read more >MT 6TFrs' Track Editors - AMTA
The Commercial MT Users and Translators Track at AMTA 2016 features presentations from organizations, enterprises, and individuals in the ...
Read more >512 Pixels
The SpaceX explosion on June 28th was caused by a failed strut in the rocket's upper ... may not be 100% accurate with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It appears to also fail on DateFormat:
Now it’s a runtime error:
Duplicate of #743