Gathering detailed insights and metrics for gettext-extractor
Gathering detailed insights and metrics for gettext-extractor
Gathering detailed insights and metrics for gettext-extractor
Gathering detailed insights and metrics for gettext-extractor
gettext-extractor-vue
Extend gettext-extractor with the possibility to parse Vue single file components
ts-gettext-extractor-linux-arm64-gnu
OS-specific binary for [ts-gettext-extractor](https://github.com/louy/ts-gettext-extractor).
ts-gettext-extractor-linux-arm64-musl
OS-specific binary for [ts-gettext-extractor](https://github.com/louy/ts-gettext-extractor).
@floratmin/gettext-extractor-js-parser
JS Extractor for gettext-extractor
A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML.
npm install gettext-extractor
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
98 Stars
100 Commits
21 Forks
4 Watching
1 Branches
9 Contributors
Updated on 16 Aug 2024
TypeScript (99.37%)
HTML (0.33%)
JavaScript (0.3%)
Cumulative downloads
Total Downloads
Last day
-6.6%
31,878
Compared to previous day
Last week
-10.7%
122,605
Compared to previous week
Last month
47.4%
545,943
Compared to previous month
Last year
31.3%
4,155,190
Compared to previous year
5
A flexible and powerful Gettext message extractor with support for JavaScript, TypeScript, JSX and HTML
It works by running your files through a parser and then uses the AST (Abstract Syntax Tree) to find and extract translatable strings from your source code. All extracted strings can then be saved as .pot
file to act as template for translation files.
Unlike many of the alternatives, this library is highly configurable and is designed to work with most existing setups.
For the full documentation check out the Github Wiki.
Note: This package requires Node.js version 6 or higher.
1yarn add gettext-extractor
1npm install gettext-extractor
Let's start with a code example:
1const { GettextExtractor, JsExtractors, HtmlExtractors } = require('gettext-extractor'); 2 3let extractor = new GettextExtractor(); 4 5extractor 6 .createJsParser([ 7 JsExtractors.callExpression('getText', { 8 arguments: { 9 text: 0, 10 context: 1 11 } 12 }), 13 JsExtractors.callExpression('getPlural', { 14 arguments: { 15 text: 1, 16 textPlural: 2, 17 context: 3 18 } 19 }) 20 ]) 21 .parseFilesGlob('./src/**/*.@(ts|js|tsx|jsx)'); 22 23extractor 24 .createHtmlParser([ 25 HtmlExtractors.elementContent('translate, [translate]') 26 ]) 27 .parseFilesGlob('./src/**/*.html'); 28 29extractor.savePotFile('./messages.pot'); 30 31extractor.printStats();
A detailed explanation of this code example and much more can be found in the Github Wiki.
From reporting a bug to submitting a pull request: every contribution is appreciated and welcome. Report bugs, ask questions and request features using Github issues. If you want to contribute to the code of this project, please read the Contribution Guidelines.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 5/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
34 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More