Skip to content
Discussion options

You must be logged in to vote

After trying different approaches, I settled on this the most simple and clean approach of translating messages in pure JS without macros:

const text = i18n.t(/* i18n */ '{subject} on {domain}', {
  subject: 'foo',
  domain: 'bar,
})

It works well and using the /* i18n */ comment, the extractor detects and extracts the string correctly. The issue is only with complex scenarios where I need to pass the context to the message, for this I created a separate question: #2490

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@MurzNN
Comment options

@MurzNN
Comment options

@timofei-iatsenko
Comment options

@MurzNN
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MurzNN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants