Skip to content

Can I get compiled message functions as raw string from getLocaleMessage()? #662

Answered by kuanyui
kuanyui asked this question in Q&A
Discussion options

You must be logged in to vote

At last I wrote a fake ctx to feed these functions with the fake ctx...

  const fakeCtx = {
    normalize: (x: any[] | string) => isArr(x) ? x.join('') : x,
    interpolate: () => '',
    list: () => '',
    plural: (x: any[]) => x.join(''),
  }

Shameful but it works. 恥ずだが役に立つ。

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by kuanyui
Comment options

You must be logged in to vote
1 reply
@kuanyui
Comment options

Comment options

You must be logged in to vote
0 replies
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