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.

Idea: Help catching forgotten strings

See original GitHub issue

Hi @tricoder42 and cheers for this excellent library 🙌

What would you think about implementing some kind of debug mode in js-lingui that can be turned on/off by the developer to quickly spot the places where he forgot to use <Trans> ?

Here’s what it would look like:

Normal mode Debug mode
simulator screen shot - iphone x - 2018-03-16 at 19 53 02 simulator screen shot - iphone x - 2018-03-16 at 19 56 40

This helps to see that the last string “commented on pull request” was totally forgotten while translating the application.

The number/length of xxxx would match the original string to keep the UI balance.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tricoder42commented, Jul 23, 2018

@HriBB That’s also an interesting idea. We could leverage info about origin of messages and either show compact version (missing IDs) or verbose one (missing ID and location in code)

1reaction
tricoder42commented, Jul 23, 2018

My proposal here:

Add a new prop missing to I18nProvider. This value will be used when translation isn’t available, but only in development.

It may be a simple string:

<I18nProvider missing="xxxxxxx"><App /></I18nProvider>

or a fancy component which reports all missing translations (pseudo code):

const missing = {}

function DebugToolbarSink({ language, id }) {
   missing[language] = missing[language] || {}
   missing[language][id] = true
   return '⚠️'
}

function DebugToolbar() {
  return <ul>{Object.keys(missing[language]).map(id => <li>id</id>)}</ul>
}

<I18nProvider missing={DebugToolbarSink}>
   <App />
   <DebugToolbar />
</I18nProvider>
Read more comments on GitHub >

github_iconTop Results From Across the Web

18 Tips for How to Catch a Hard to Trap Feral or Stray Cat
Use enough string so you can hide a few feet away and hold the end of it. When the tricky kitty walks into...
Read more >
Forgotten Beast trap help/Ideas. : r/dwarffortress - Reddit
I had a quick questions for you urists. I wanted to make a trap to catch and kill forgotten beasts. Can I make...
Read more >
This is a close-up of what a glow-worm looks like. The sticky strings ...
The sticky strings catch insects who get lost in the darkness of the cave systems, and fly upwards towards what they think is...
Read more >
Memory Lapse or Dementia? 5 Clues to Help Tell the Difference
An occasional memory slip is normal, but how can you tell if it may be something more serious?
Read more >
Kirby And The Forgotten Land: How To Beat Sillydillo
Sillydillo can be a tough fight for players expecting an easy win in Kirby and the Forgotten Land. Here's how you can beat...
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