messages.json is looking different than in documentation
See original GitHub issueFollowing https://lingui.gitbooks.io/js/tutorials/react.html got me to:
Now we're ready to extract messages:
$ lingui extract
And then it shows nicely formatted language file:
{
"Message Inbox": "",
"See all <0>unread messages</0> or <1>mark them</1> as read.": "",
"{messagesCount, plural, one {There's {messagesCount} message in your inbox.} other {There're {messagesCount} messages in your inbox.}}": "",
"Last login on {lastLogin, date}": ""
}
However mine looks very different, containing origin values (it does compile though):
{
"StringOne": {
"translation": "",
"origin": [
[
"src\\components\\common\\Header.js",
26
]
]
},
"StringTwo": {
"translation": "",
"origin": [
[
"src\\components\\common\\Header.js",
53
]
]
}
}
What am I doing wrong? I was just following the tutorial.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Working with JSON - Learn web development | MDN
In this article, we've given you a simple guide to using JSON in your programs, including how to create and parse JSON, and...
Read more >Syntax for documenting JSON structure - Stack Overflow
Other than this, my personal opinion is that since JSON is predominantly used for transferring objects, documenting equivalent objects in ...
Read more >Parsing message formats - Amazon Simple Notification Service
Describes the message and JSON formats that Amazon SNS supports.
Read more >Working with Messages - JSON - 9.8 Technical Documentation
In this learning activity, the first name and last name nodes are mapped to names different that the default value name. Learning activity....
Read more >An Introduction to JSON | DigitalOcean
JSON — short for JavaScript Object Notation — is a format for sharing data. As its name suggests, JSON is derived from the...
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 FreeTop 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
Top GitHub Comments
Use
i18n._("Raw string")
for this, that’s the “raw” method. In React, you have to use<Trans id="Raw string" />
. I’ll add this into docs.However, this way the message won’t be extracted. I need to add sth like
i18n.noop
which will just mark static messages for extraction, but won’t perform any translation. So your example would be:And later you would use:
Good points anyway. Thank you and sorry for any inconveniences.
Create a new issue for this feature: #60