Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse text error if text has point number in tsx. #214

Open
shenghou opened this issue Jul 6, 2021 · 0 comments
Open

Parse text error if text has point number in tsx. #214

shenghou opened this issue Jul 6, 2021 · 0 comments

Comments

@shenghou
Copy link

shenghou commented Jul 6, 2021

🐛 Bug Report

Use scanner parser API to get words and words contains point number, such as t('version 1.23.9'), the result of parse is version 1, the 23.9 has been truncated.

To Reproduce

A codesandbox example or similar
or at least steps to reproduce the behavior:

 // parse 
 const parser = new scanner.Parser();
  const filePath = getFile(`${process.cwd()}/src`, []);
  const words = [];
  filePath.forEach((path) => {
    const content = fs.readFileSync(path, 'utf-8');
    parser.parseFuncFromString(content, {
      list: ['t'],
      extensions: ['.ts', '.tsx'],
    });
    const tsxValue = parser.get();   // 1   
    const lang = Object.keys(tsxValue)[0];
    const value = tsxValue[lang]['translation'];
    words.push(...Object.keys(value));
  });

  // 

	
 // file 
 const VERSION = t('vsersion 1.2.1');

Expected behavior

A clear and concise description of what you expected to happen.

// Paste the expected results here

Your Environment

  • runtime version: i.e. node v12.18.2
  • i18next version: i.e. 19.8.4
  • i18next-scanner version: i.e. 3.0.0
  • os: Mac
  • any other relevant information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant