extract-i18n
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

extract-i18n

Introduction

Based on grep, extract text from project directory

Install

$ npm install --save-dev extract-i18n

or

$ yarn add -D extract-i18n

Noted

If you are using a Mac, you need to install grep

brew install grep

Usage

example/default.ts

import React from 'react';

export function App() {
  const word1 = t('Hello');
  const word2 = t(`word`);
  const word3 = t('Hello, word');
  return (
    <div>
      {word1}
      {word2}
      {word3}
    </div>
  );
}
import { extract } from 'extract-i18n';

const words = extract({
  path: 'example', // your folder/file
});

console.log(words);

//output
// ['Hello', 'word', 'Hello, word'];

Readme

Keywords

none

Package Sidebar

Install

npm i extract-i18n

Weekly Downloads

15

Version

1.0.0

License

none

Unpacked Size

2.76 kB

Total Files

4

Last publish

Collaborators

  • m-ryan