question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pseudolocalization fails with exact or offsetting plurals

See original GitHub issue

Describe 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

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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
redbugzcommented, Feb 26, 2019

It appears to also fail on DateFormat:

<Trans>
    Last login on <DateFormat value={lastLogin} />.
</Trans>

Now it’s a runtime error:

core.development.js:143 Uncaught TypeError: formatters[type] is not a function
    at ctx (core.development.js:143)
    at LastLoginOnLastLoginDate (messages.js:1)
image
0reactions
tricoder42commented, Nov 4, 2020

Duplicate of #743

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found