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.

Call missingMessage when translation key is empty

See original GitHub issue

Please consider the scenario where we have 2 translation files:

# en-us.yml
sample_translation:
    translation_1: Lorem ipsum
    translation_2: dolor sit amet
# de-de.yml
sample_translation:
    translation_1: Lorem ipsum
    translation_2: 

In this case while using German translations within the application, when we encounter sample_translation.translation_2 an error ‚A message must be provided as a String or AST.’ will be thrown and app will break.

If we could run missingMessage not only when translation is undefined, but also when it is null (key exists but there is no translation text) the error from MessageFormat won’t be thrown.

What do you think? Does it make any sense?

If it does, I can try to prepare PR for this one 😃

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
buschtoenscommented, Aug 17, 2018

Hm, I see. 🙂

Maybe it would make more sense to strip these null keys during build time, since they unnecessarily inflate the size of the translations bundle?

If your translations tool does not support that, I’m sure we can accommodate for that. We wanted to beef up our build pipeline anyway. 💪

Would this be an alright solution for you?

0reactions
stale[bot]commented, Oct 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase transaction api call current data is null - Stack Overflow
Firebase usually returns a null value while retrieving a key for the first time but while saving it checks if the new value...
Read more >
My transaction didn't process and I received a transaction ...
Pick up Card, This error message implies that the credit card being used has been reported lost or stolen with the credit card...
Read more >
Error Codes Guide - Developer Central - Verifone
Display Message Additional Display Message Possible Reasons for the Message Success The transaction is successful. Transaction Cancelled Operator Abort Transaction Cancelled Operator Timeout
Read more >
Posting keys for account determination for transaction RWS do ...
Because the posting key is missing, the system cannot generate any automatic postings. Maintain the posting keys necessary for transaction RWS.
Read more >
Payment Transaction Response Codes - Worldpay Support
Response Code Response Message Response Type 001 Transaction Received Info 000 Approved Approved 010 Partially Approved Approved
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